/* Demo Master — Cloudflare Workers Design System (legacy cream) */
:root {
  --cf-orange: #ff4801;
  --cf-orange-hover: #ff7038;
  --cf-orange-light: rgba(255, 72, 1, 0.08);
  --cf-text: #521000;
  --cf-text-muted: rgba(82, 16, 0, 0.7);
  --cf-text-subtle: rgba(82, 16, 0, 0.4);
  --cf-bg-page: #f5f1eb;
  --cf-bg-100: #fffbf5;
  --cf-bg-200: #fffdfb;
  --cf-bg-300: #fef7ed;
  --cf-border: #ebd5c1;
  --cf-border-light: rgba(235, 213, 193, 0.5);
  --cf-success: #16a34a;
  --cf-success-bg: #dcf7e3;
  --cf-warning: #b45309;
  --cf-warning-bg: #fef3c7;
  --cf-error: #dc2626;
  --cf-error-bg: #fde8e8;
  --cf-compute: #0a95ff;
  --cf-storage: #ee0ddb;
  --cf-ai: #19e306;
  --cf-media: #9616ff;
  --code-bg: #1a1209;
  --code-text: #e0d4c8;
  --font-sans: "FT Kunst Grotesk", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Apercu Mono Pro", ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, monospace;
  --shadow-card: 0 1px 3px rgba(82, 16, 0, 0.04), 0 4px 12px rgba(82, 16, 0, 0.02);
  --shadow-focus: 0 0 0 3px rgba(255, 72, 1, 0.15);
  --ease-button: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);
  --dash-h: linear-gradient(to right, var(--cf-border) 50%, transparent 50%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --cf-orange: #f14602;
    --cf-orange-hover: #ff6d33;
    --cf-orange-light: rgba(241, 70, 2, 0.14);
    --cf-text: #f0e3de;
    --cf-text-muted: rgba(255, 253, 251, 0.62);
    --cf-text-subtle: rgba(255, 253, 251, 0.38);
    --cf-bg-page: #0d0d0d;
    --cf-bg-100: #121212;
    --cf-bg-200: #191817;
    --cf-bg-300: #2a2927;
    --cf-border: rgba(240, 227, 222, 0.13);
    --cf-border-light: rgba(240, 227, 222, 0.07);
    --cf-success: #4ade80;
    --cf-success-bg: rgba(74, 222, 128, 0.12);
    --cf-warning: #facc15;
    --cf-warning-bg: rgba(250, 204, 21, 0.12);
    --cf-error: #f87171;
    --cf-error-bg: rgba(248, 113, 113, 0.12);
    --code-bg: #0a0806;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--cf-bg-100);
  color: var(--cf-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: rgba(255, 72, 1, 0.2); color: var(--cf-text); }
:focus-visible { outline: 2px solid var(--cf-orange); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.02em; }
strong, b { font-weight: 500; }
code, .mono { font-family: var(--font-mono); }

/* ---------- Decorative ---------- */
.brackets { position: relative; }
.brackets > .br {
  position: absolute; width: 8px; height: 8px; border: 1px solid var(--cf-border);
  border-radius: 1.5px; background: var(--cf-bg-100); pointer-events: none; z-index: 2;
}
.br.tl { top: -4px; left: -4px; } .br.tr { top: -4px; right: -4px; }
.br.bl { bottom: -4px; left: -4px; } .br.brr { bottom: -4px; right: -4px; }
.dots { background-image: radial-gradient(circle, var(--cf-border) 0.75px, transparent 0.75px); background-size: 14px 14px; }
.dash-line { height: 1px; background-image: var(--dash-h); background-size: 12px 1px; background-repeat: repeat-x; }

/* ---------- Header ---------- */
header.top {
  position: sticky; top: 0; z-index: 50; height: 60px; background: var(--cf-bg-100);
  display: flex; align-items: center; padding: 0 24px;
}
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background-image: var(--dash-h); background-size: 12px 1px; }
.header-inner { width: 100%; max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--cf-text); text-decoration: none; }
.logo svg { height: 24px; color: var(--cf-orange); }
.logo-text { font-size: 16px; font-weight: 500; letter-spacing: -0.46px; }
.logo-text span { color: var(--cf-text-muted); font-weight: 400; }
nav.pills { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: min(860px, 62vw); mask-image: linear-gradient(to right, #000 92%, transparent); }
nav.pills::-webkit-scrollbar { display: none; }
nav.pills a { white-space: nowrap; }
nav.pills a {
  padding: 8px 16px; border-radius: 9999px; font-size: 14px; font-weight: 500; color: var(--cf-text-muted);
  text-decoration: none; border: 1px solid transparent; transition: all 0.15s ease;
}
nav.pills a:hover { background: var(--cf-bg-300); color: var(--cf-text); border: 1px dashed var(--cf-border); }
nav.pills a.active { background: var(--cf-orange); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px;
  border-radius: 9999px; font: 500 15px/1 var(--font-sans); cursor: pointer; border: 1px solid transparent;
  text-decoration: none; white-space: nowrap;
  transition: all 0.16s var(--ease-button);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-secondary { background: var(--cf-orange); color: #fff; }
.btn-secondary:hover { opacity: 0.95; border-style: dashed; border-color: rgba(255, 255, 255, 0.5); }
.btn-ghost { background: transparent; color: var(--cf-orange); border-color: var(--cf-border); }
.btn-ghost:hover { border-style: dashed; border-color: var(--cf-orange); color: var(--cf-text); }
.btn-outline { background: var(--cf-bg-200); color: var(--cf-text); border-color: var(--cf-border); }
.btn-outline:hover { background: var(--cf-bg-300); border-style: dashed; }
.btn-outline.on { border-color: var(--cf-orange); color: var(--cf-orange); background: var(--cf-orange-light); }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 0 24px 80px; }
.view { animation: fadeSlideUp 0.5s var(--ease-entrance) both; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eyebrow { font: 400 12px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--cf-text-muted); }

/* Hero */
.hero {
  margin-top: 32px; padding: 64px 48px; border: 1px solid var(--cf-border); border-radius: 16px;
  background-color: var(--cf-bg-200); text-align: center; overflow: visible;
}
.hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.05; letter-spacing: -0.035em; margin: 16px auto 16px; max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--cf-orange); }
.hero p { font-size: 18px; color: var(--cf-text-muted); max-width: 620px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 9999px; font-size: 12px;
  font-weight: 500; background: var(--cf-orange-light); color: var(--cf-orange);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Section title */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 56px 0 20px; padding-top: 28px; position: relative; }
.section-head::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background-image: var(--dash-h); background-size: 12px 1px; }
.section-head h2 { font-size: 24px; }
.section-head p { color: var(--cf-text-muted); font-size: 14px; }

/* Demo cards */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.card {
  background: var(--cf-bg-200); border: 1px solid var(--cf-border); border-radius: 12px; padding: 24px;
  box-shadow: var(--shadow-card);
}
.demo-card { cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 12px; transition: background 0.2s ease, border-color 0.2s ease; }
.demo-card:hover { background: var(--cf-bg-300); border-style: dashed; border-color: var(--cf-orange); }
.demo-card .icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; }
.demo-card .icon svg { width: 20px; height: 20px; }
.demo-card h3 { font-size: 17px; }
.demo-card p { font-size: 14px; color: var(--cf-text-muted); flex: 1; }
.demo-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--cf-text-subtle); }
.demo-card .go { color: var(--cf-orange); font-weight: 500; font-size: 14px; }
.cat { padding: 2px 8px; border-radius: 9999px; font: 400 11px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }

/* How it works steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-num { font: 400 12px var(--font-mono); color: var(--cf-orange); margin-bottom: 8px; }
.step h4 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--cf-text-muted); }

/* ---------- Stage ---------- */
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 32px 0 24px; flex-wrap: wrap; }
.stage-head h1 { font-size: 30px; letter-spacing: -0.035em; }
.stage-head p { color: var(--cf-text-muted); font-size: 15px; margin-top: 4px; max-width: 640px; }
.back { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--cf-text-muted); text-decoration: none; margin-top: 24px; }
.back:hover { color: var(--cf-orange); }
.stage { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.panel { padding: 0; }
.panel-head { padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--cf-border-light); }
.panel-head h3 { font-size: 16px; }
.panel-body { padding: 24px; }

/* Forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
label.field span.hint { font-weight: 400; color: var(--cf-text-subtle); font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--cf-border); background: var(--cf-bg-200); color: var(--cf-text);
  font: 400 14px var(--font-sans); border-radius: 8px; padding: 12px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input { font-family: var(--font-mono); font-size: 13px; resize: vertical; min-height: 72px; }
.input:focus { border-color: var(--cf-orange); box-shadow: var(--shadow-focus); }
.input::placeholder { color: var(--cf-text-subtle); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle-group { display: inline-flex; border: 1px solid var(--cf-border); border-radius: 9999px; overflow: hidden; }
.toggle-group button { padding: 8px 16px; font: 500 13px var(--font-sans); border: 0; background: var(--cf-bg-200); color: var(--cf-text); cursor: pointer; transition: all 0.15s ease; }
.toggle-group button:hover { background: var(--cf-bg-300); }
.toggle-group button.on { background: var(--cf-orange); color: #fff; }

.presenter-hint { font: 400 11px var(--font-mono); color: var(--cf-text-subtle); }

/* Console */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.terminal { background: var(--code-bg); color: var(--code-text); border-radius: 12px; font: 400 12.5px/1.6 var(--font-mono); padding: 16px 20px; min-height: 180px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid rgba(235, 213, 193, 0.15); }
.terminal .k { color: #ffb38a; } .terminal .s { color: #a5d6a7; } .terminal .n { color: #90caf9; } .terminal .dim { color: rgba(224, 212, 200, 0.45); }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9999px; font: 500 12px var(--font-sans); border: 1px solid transparent; }
.pill.ok { background: var(--cf-success-bg); color: var(--cf-success); }
.pill.warn { background: var(--cf-warning-bg); color: var(--cf-warning); }
.pill.bad { background: var(--cf-error-bg); color: var(--cf-error); }
.pill.neutral { background: var(--cf-bg-300); color: var(--cf-text-muted); border-color: var(--cf-border-light); }

/* Score bars */
.scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.score { padding: 12px; border: 1px solid var(--cf-border); border-radius: 8px; background: var(--cf-bg-200); }
.score .label { font: 400 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--cf-text-muted); }
.score .val { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin: 2px 0 8px; }
.bar { height: 6px; border-radius: 9999px; background: var(--cf-border-light); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 9999px; background: var(--cf-orange); width: 0; transition: width 0.5s ease-out; }

/* Account card */
.account { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--cf-orange-light); color: var(--cf-orange); display: grid; place-items: center; font-weight: 500; font-size: 18px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin-top: 16px; }
.kv dt { color: var(--cf-text-muted); } .kv dd { font-family: var(--font-mono); }

/* Tally */
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { text-align: center; padding: 16px 8px; }
.stat .num { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; color: var(--cf-orange); }
.stat .lbl { font: 400 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--cf-text-muted); margin-top: 4px; }

.callout { padding: 12px 16px; border-radius: 0 8px 8px 0; border-left: 3px solid var(--cf-orange); background: var(--cf-orange-light); font-size: 13px; color: var(--cf-text); margin-top: 16px; }
.callout code { font-size: 12px; }
.empty { text-align: center; padding: 32px 16px; color: var(--cf-text-subtle); font-size: 14px; }
.empty svg { width: 28px; height: 28px; margin-bottom: 8px; color: var(--cf-border); }

footer.foot { max-width: 1280px; margin: 0 auto; padding: 24px; font-size: 13px; color: var(--cf-text-subtle); position: relative; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.foot::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background-image: var(--dash-h); background-size: 12px 1px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--cf-text); color: var(--cf-bg-100); padding: 10px 18px; border-radius: 9999px; font-size: 14px; z-index: 100; animation: fadeSlideUp 0.3s var(--ease-entrance); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stage { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  nav.pills { display: none; }
  .grid-4, .steps, .form-grid { grid-template-columns: 1fr; }
  .scores, .tally { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 40px 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* AI Agents console */
.agent-log { height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--cf-border); border-radius: 8px; background: var(--cf-bg-100); }
.agent-log .empty { margin: auto; }
.agent-msg { display: flex; }
.agent-msg.user { justify-content: flex-end; }
.agent-bubble { max-width: 85%; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--cf-border); background: var(--cf-bg-200); font-size: 14px; line-height: 1.55; }
.agent-msg.user .agent-bubble { background: var(--cf-orange-light); border-color: transparent; }
.agent-text { white-space: pre-wrap; word-break: break-word; }
.agent-tool { border: 1px dashed var(--cf-border); border-radius: 8px; padding: 8px 10px; background: var(--cf-bg-100); }
.agent-tool-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.agent-tool-head .mono { display: inline-flex; align-items: center; gap: 6px; }
.agent-tool pre.terminal { margin: 8px 0 0; font-size: 12px; min-height: 0; padding: 8px 12px; max-height: 160px; overflow: auto; }
.agent-err { color: var(--cf-error); font-size: 13px; margin-top: 6px; }
.agent-form { display: flex; gap: 8px; margin-top: 12px; }
.agent-form .input { flex: 1; }
.agent-typing { display: inline-flex; gap: 4px; }
.agent-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--cf-text-subtle); animation: agentBlink 1.2s infinite ease-in-out; }
.agent-typing i:nth-child(2) { animation-delay: 0.2s; } .agent-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes agentBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* API Shield / Page Shield / Uploads consoles */
.lead-s { font-size: 14px; color: var(--cf-text-muted); margin-bottom: 14px; }
.shield-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--cf-border-light); font-size: 13px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 16px; }
table.mini th { text-align: left; font-weight: 500; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--cf-border); }
table.mini td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--cf-border-light); vertical-align: top; }
.ps-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ps-frame { width: 100%; height: 470px; border: 1px solid var(--cf-border); border-radius: 12px; background: #f8fafc; }
.ps-safe { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--cf-success-bg); color: var(--cf-success); font-size: 13px; }
.up-obj { padding: 10px 12px; border: 1px dashed var(--cf-border); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.up-obj ul { margin: 6px 0 0 18px; color: var(--cf-error); }
@media (max-width: 1024px) { .ps-grid { grid-template-columns: 1fr; } }

/* ---- AI Agent: "Behind the scenes" panel beside the chat ---- */
.agent-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.agent-chat { min-width: 0; }
.agent-bts { border: 1px solid var(--cf-border); border-radius: 8px; background: var(--cf-bg-100); padding: 12px; display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow-y: auto; }
.bts-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bts-flow { display: flex; flex-direction: column; }
.bts-node { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--cf-border-light); border-radius: 8px; background: var(--cf-bg-200); transition: border-color .25s, background .25s, box-shadow .25s; }
.bts-node.on { border-color: var(--cf-orange); background: var(--cf-orange-light); box-shadow: 0 0 0 3px var(--cf-orange-light); }
.bts-node.on .bts-ic { color: var(--cf-orange); animation: btsPulse 1.2s ease-in-out infinite; }
.bts-ic { display: inline-flex; color: var(--cf-text-muted); }
.bts-name { font-size: 13px; font-weight: 500; }
.bts-sub { font-size: 11px; color: var(--cf-text-muted); word-break: break-word; }
.bts-link { width: 2px; height: 10px; margin-left: 21px; background: var(--cf-border); }
.bts-link.on { background: var(--cf-orange); }
.bts-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; padding: 8px 10px; border: 1px dashed var(--cf-border); border-radius: 8px; }
.bts-facts div { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.bts-facts span { color: var(--cf-text-muted); white-space: nowrap; }
.bts-facts b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bts-turns { display: flex; flex-direction: column; gap: 8px; }
.bts-turn { border: 1px solid var(--cf-border-light); border-radius: 8px; background: var(--cf-bg-200); }
.bts-turn summary { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; cursor: pointer; font-size: 13px; font-weight: 500; list-style: none; }
.bts-turn summary::-webkit-details-marker { display: none; }
.bts-rows { list-style: none; margin: 0; padding: 0 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.bts-rows li { display: grid; grid-template-columns: 64px 10px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 12px; animation: btsIn .25s ease-out; }
.bts-off { color: var(--cf-text-subtle); font-size: 11px; text-align: right; padding-top: 1px; }
.bts-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; background: var(--cf-border); }
.bts-dot.n-browser { background: #6366f1; } .bts-dot.n-edge, .bts-dot.n-hub { background: var(--cf-orange); }
.bts-dot.n-do { background: #0ea5e9; } .bts-dot.n-ai { background: #a855f7; } .bts-dot.n-tools { background: #14b8a6; }
.bts-label { font-weight: 500; }
.bts-detail { color: var(--cf-text-muted); word-break: break-word; }
.bts-rows li.ok .bts-label { color: var(--cf-success); }
.bts-rows li.warn .bts-label { color: var(--cf-warning); }
.bts-rows li.bad .bts-label { color: var(--cf-error); }
.bts-note { font-size: 11.5px; color: var(--cf-text-muted); line-height: 1.5; border-top: 1px solid var(--cf-border-light); padding-top: 8px; }
@keyframes btsPulse { 50% { opacity: .45; } }
@keyframes btsIn { from { opacity: 0; transform: translateY(-3px); } }
@media (max-width: 900px) { .agent-split { grid-template-columns: 1fr; } .agent-bts { max-height: none; } }
@media (prefers-reduced-motion: reduce) { .bts-node.on .bts-ic, .bts-rows li { animation: none; } }

/* AI Gateway DLP: upload results */
.upload-card { border: 1px solid var(--cf-border-light); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.upload-card .pipeline { margin: 0 0 10px 18px; padding: 0; font-size: 12.5px; line-height: 1.6; }
.upload-card pre.terminal.upload-text { min-height: 0; padding: 8px 12px; font-size: 12px; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 4px 0 10px; }
.callout.bad { border-left-color: #e5484d; background: transparent; }
.presets .sample { display: inline-flex; align-items: center; gap: 4px; }
.presets .sample a { text-decoration: none; padding: 0 4px; }
.agent-stack { display: flex; flex-direction: column; gap: 12px; }
.agent-bts-wrap { border: 1px solid var(--cf-border); border-radius: 8px; background: var(--cf-bg-100); }
.agent-bts-wrap > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 10px 12px; }
.agent-bts-wrap > summary::-webkit-details-marker { display: none; }
.agent-bts-wrap > summary::before { content: "\25B8"; color: var(--cf-text-subtle); transition: transform 0.15s; }
.agent-bts-wrap[open] > summary::before { transform: rotate(90deg); }
.agent-bts-wrap > .agent-bts { border: 0; border-top: 1px solid var(--cf-border); border-radius: 0 0 8px 8px; max-height: 560px; }

/* Agent chat attachments */
.agent-attach { padding-left: 10px; padding-right: 10px; display: inline-flex; align-items: center; }
.agent-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 10px; border: 1px solid var(--cf-border); border-radius: 8px; background: var(--cf-bg-200); font-size: 13px; }
.agent-chip[hidden] { display: none; }
.agent-chip > .small { color: var(--cf-text-muted); flex: 1; min-width: 180px; }
.agent-chip.ok { border-color: var(--cf-success); }
.agent-chip.warn { border-color: var(--cf-warning); }
.agent-chip.bad { border-color: var(--cf-error); }
.agent-chip.bad > .small { color: var(--cf-error); }
.agent-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.agent-file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; margin: 2px 0; border: 1px solid var(--cf-border); border-radius: 6px; background: var(--cf-bg-100); font-size: 12px; max-width: 100%; }
.agent-msg.user .agent-file { background: var(--cf-bg-100); align-self: flex-end; }

/* Behind the scenes: security section */
.bts-sec { border: 1px solid var(--cf-border-light); border-radius: 8px; background: var(--cf-bg-200); }
.bts-sec > summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; }
.bts-sec > summary::-webkit-details-marker { display: none; }
.bts-sec > summary .bts-name { display: inline-flex; align-items: center; gap: 6px; }
.bts-sec-list { list-style: none; margin: 0; padding: 0 10px 8px; display: flex; flex-direction: column; gap: 8px; }
.bts-sec-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 12px; padding-top: 8px; border-top: 1px dashed var(--cf-border-light); }
.bts-sec-name { font-weight: 500; }
.bts-sec-what { grid-column: 1 / 2; color: var(--cf-text-muted); line-height: 1.45; }
.bts-sec-status { grid-column: 2 / 3; grid-row: 1 / 3; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: flex-start; }
.bts-sec-last { grid-column: 1 / 3; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; color: var(--cf-text-subtle); word-break: break-word; }
.bts-dot.n-ocr { background: #eab308; } .bts-dot.n-gateway { background: #dc2626; }

/* Page Shield: one record per checkout page load */
.ps-loads { display: flex; flex-direction: column; gap: 8px; }
.ps-load { border: 1px solid var(--cf-border); border-radius: 8px; background: var(--cf-bg-100); }
.ps-load > summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; }
.ps-load > summary::-webkit-details-marker { display: none; }
.ps-load > summary::before { content: "\25B8"; color: var(--cf-text-subtle); transition: transform 0.15s; }
.ps-load[open] > summary::before { transform: rotate(90deg); }
.ps-load-title, .ps-load-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ps-load-title { flex: 1; }
.ps-load-body { padding: 0 12px 12px; border-top: 1px solid var(--cf-border-light); }
.ps-req { margin: 10px 0; padding: 8px 10px; border: 1px dashed var(--cf-border); border-radius: 8px; display: flex; flex-direction: column; gap: 4px; }
.ps-h { display: block; font-size: 13px; margin: 12px 0 4px; }
.ps-pay { margin: 4px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ps-pay ul { margin: 4px 0 0; padding-left: 16px; }
.ps-pay li.bad { color: var(--cf-error); } .ps-pay li.ok { color: var(--cf-success); }
.ps-policy { display: inline; word-break: break-word; font-size: 11px; }

/* Page Shield: routes, presenter mode, live inventory */
.ps-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border: 1px solid var(--cf-border); border-radius: 999px; cursor: pointer; }
.ps-chk input { margin: 0; }
.ps-presenter { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--cf-orange, #f6821f); border-radius: 10px; background: var(--cf-bg-100); }
.ps-steps { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ps-steps button { font-size: 12px; padding: 4px 8px; border: 1px solid var(--cf-border); border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.ps-steps button.done { opacity: 0.7; }
.ps-steps button.on { background: var(--cf-orange, #f6821f); border-color: var(--cf-orange, #f6821f); color: #fff; }
.ps-talk { margin-top: 8px; font-size: 14px; }
tr.ps-ver td { padding-top: 0; border-top: none; }
.ps-outcome { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.ps-q { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--cf-border); border-radius: 10px; background: var(--cf-bg-100); font-size: 14px; }
.ps-q > span:first-child { font-weight: 500; }
.ps-adv { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--cf-border); border-radius: 10px; }
.ps-adv > summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.ps-lab-entry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--cf-border); border-radius: 8px; }
.ps-lab-frame { display: block; width: 100%; height: 700px; border: 1px solid var(--cf-border); border-radius: 10px; background: var(--cf-bg-100); margin-top: 10px; }
.ps-lab-table { overflow-x: auto; }
.ps-lab-table td:first-child { min-width: 240px; max-width: 420px; overflow-wrap: anywhere; }
.ps-resource-evidence { margin-top: 6px; font: 11px/1.5 var(--font-sans, system-ui, sans-serif); overflow-wrap: anywhere; }
.ps-resource-evidence summary { cursor: pointer; color: var(--cf-text-secondary); }
.ps-version-evidence { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--cf-border-light); }
tr.ps-finding-malicious > td:first-child { border-left: 3px solid #d93025; padding-left: 8px; }
