/* Product UI tab - BSIO-first AI SOC, SIEM, and cybersecurity interface examples */

const ProductUITab = () => {
  const severityStyles = {
    Critical: { bg: "#FEF2F2", fg: BRAND.semantic.danger, border: "#FECACA" },
    High: { bg: "#FFF7ED", fg: "#C2410C", border: "#FED7AA" },
    Medium: { bg: "#FFFBEB", fg: "#B45309", border: "#FDE68A" },
    Low: { bg: BRAND.secondary[50], fg: BRAND.secondary[800], border: BRAND.secondary[200] },
    Info: { bg: BRAND.primary[50], fg: BRAND.primary[700], border: BRAND.primary[200] },
  };

  const statusStyles = {
    Open: { bg: "#FEF2F2", fg: BRAND.semantic.danger, border: "#FECACA" },
    Triage: { bg: BRAND.primary[50], fg: BRAND.primary[700], border: BRAND.primary[200] },
    Contained: { bg: BRAND.secondary[50], fg: BRAND.secondary[800], border: BRAND.secondary[200] },
    Suppressed: { bg: "#F3F4F6", fg: BRAND.ink.muted, border: BRAND.surface.border },
  };

  const languageRules = [
    {
      label: "Evidence before explanation",
      body: "AI summaries must cite the event, entity, rule, or field that supports the claim. Never show a model conclusion without the observable telemetry beside it.",
    },
    {
      label: "Analyst decision first",
      body: "Every surface should make the next decision obvious: investigate, contain, suppress, escalate, or close. Keep generic dashboard copy out of analyst workflows.",
    },
    {
      label: "Security fields are product UI",
      body: "Treat host.name, user.name, source.ip, process.name, rule.name, and threat.technique.id as first-class visual objects, not backend implementation details.",
    },
    {
      label: "Threat mapping is visible",
      body: "Show ATT&CK technique, tactic, detection source, confidence, and false-positive notes close to the alert so the analyst can evaluate coverage quickly.",
    },
  ];

  const socMetrics = [
    { label: "Open incidents", value: "18", detail: "4 critical", color: BRAND.semantic.danger },
    { label: "AI triaged", value: "73%", detail: "last 24h", color: BRAND.primary[500] },
    { label: "MTTA", value: "7m", detail: "median", color: BRAND.secondary[600] },
    { label: "Noisy rules", value: "6", detail: "needs tuning", color: BRAND.semantic.warning },
  ];

  const alertRows = [
    {
      id: "INC-4027",
      title: "Suspicious encoded PowerShell from finance workstation",
      severity: "High",
      status: "Triage",
      source: "EDR + PowerShell",
      entity: "FIN-LAP-042",
      user: "mira.chen",
      technique: "T1059 / T1027",
      risk: "91",
      signal: "winword.exe spawned powershell.exe with EncodedCommand and outbound HTTPS to 203.0.113.44",
      action: "Isolate host, collect memory, review document attachment",
    },
    {
      id: "INC-4019",
      title: "Impossible travel with MFA fatigue on privileged account",
      severity: "Critical",
      status: "Open",
      source: "IdP + VPN",
      entity: "okta:admin.jpatel",
      user: "jpatel-admin",
      technique: "T1078",
      risk: "96",
      signal: "Successful login from 198.51.100.23 seven minutes after Denver login; 11 MFA prompts before success",
      action: "Revoke sessions, reset factors, verify admin role changes",
    },
    {
      id: "INC-4008",
      title: "Cloud backup object encryption spike",
      severity: "Critical",
      status: "Contained",
      source: "Cloud audit + storage",
      entity: "prod-backup-us-east-1",
      user: "svc-backup-prod",
      technique: "T1486",
      risk: "94",
      signal: "1,284 objects encrypted with customer-provided key in 9 minutes from unusual API path",
      action: "Disable key path, preserve logs, validate restore point",
    },
    {
      id: "INC-3996",
      title: "Beacon-like DNS from build runner",
      severity: "Medium",
      status: "Triage",
      source: "DNS + NetFlow",
      entity: "CI-RUNNER-17",
      user: "gitlab-runner",
      technique: "T1071",
      risk: "72",
      signal: "Periodic TXT lookups every 60 seconds to update-cdn.example with low byte count",
      action: "Compare to build job timeline, block domain if unrelated",
    },
  ];

  const fieldRows = [
    ["@timestamp", "2026-05-12T13:42:18Z", "Sort, timeline, retention, SLA timers"],
    ["event.kind", "alert", "Separates alerts from raw events and metrics"],
    ["event.category", "process", "Powers filters, chart grouping, rule scope"],
    ["host.name", "FIN-LAP-042", "Primary endpoint entity"],
    ["user.name", "mira.chen", "Primary human or service principal"],
    ["source.ip", "10.42.18.55", "Sender of network exchange when available"],
    ["destination.ip", "203.0.113.44", "Remote peer for enrichment and blocking"],
    ["process.name", "powershell.exe", "Process-level pivot field"],
    ["process.parent.name", "winword.exe", "Parent/child relationship for execution context"],
    ["threat.technique.id", "T1059, T1027", "ATT&CK mapping for coverage and reporting"],
    ["rule.name", "Encoded PowerShell From Office", "Detection ownership and tuning"],
    ["risk_score", "91", "Prioritization and queue ordering"],
  ];

  const aiEvidence = [
    {
      label: "Primary reason",
      value: "Office spawned PowerShell with encoded command line.",
      evidence: "process.parent.name=winword.exe, process.name=powershell.exe, process.command_line contains EncodedCommand",
    },
    {
      label: "Correlated signal",
      value: "Outbound connection followed within 14 seconds.",
      evidence: "destination.ip=203.0.113.44, destination.port=443, network.bytes=18472",
    },
    {
      label: "False-positive check",
      value: "No matching admin script allowlist or signed automation package.",
      evidence: "rule.allowlist=false, code_signature.trusted=false, asset.tier=Finance",
    },
  ];

  const responseSteps = [
    ["01", "Contain", "Isolate FIN-LAP-042 from network; keep EDR live response channel open."],
    ["02", "Preserve", "Collect process tree, memory snapshot, document hash, and PowerShell transcript."],
    ["03", "Scope", "Search for same command hash, parent process, destination IP, and user across 24h."],
    ["04", "Decide", "Escalate to incident if same pattern appears on two or more hosts or privileged accounts."],
  ];

  const sigmaRule = `title: Encoded PowerShell Spawned From Office
id: 7f9b1f50-9b5c-4c84-9e18-2a1f7f5b4027
status: test
description: Detects Office spawning PowerShell with encoded command content.
logsource:
  product: windows
  category: process_creation
detection:
  selection_parent:
    ParentImage|endswith:
      - "\\\\WINWORD.EXE"
      - "\\\\EXCEL.EXE"
      - "\\\\POWERPNT.EXE"
  selection_child:
    Image|endswith: "\\\\powershell.exe"
    CommandLine|contains:
      - "-EncodedCommand"
      - "FromBase64String"
  condition: selection_parent and selection_child
fields:
  - UtcTime
  - Computer
  - User
  - ParentImage
  - Image
  - CommandLine
falsepositives:
  - Approved macro administration scripts
level: high
tags:
  - attack.execution
  - attack.defense_evasion
  - attack.t1059
  - attack.t1027`;

  const rawEvent = `{
  "@timestamp": "2026-05-12T13:42:18Z",
  "event.kind": "alert",
  "event.category": "process",
  "event.action": "start",
  "host.name": "FIN-LAP-042",
  "user.name": "mira.chen",
  "process.parent.name": "winword.exe",
  "process.name": "powershell.exe",
  "process.command_line": "powershell.exe -NoP -EncodedCommand JAB3AGM...",
  "source.ip": "10.42.18.55",
  "destination.ip": "203.0.113.44",
  "destination.port": 443,
  "rule.name": "Encoded PowerShell From Office",
  "risk_score": 91,
  "threat.technique.id": ["T1059", "T1027"]
}`;

  const huntQuery = `event.category:process
AND process.name:powershell.exe
AND process.command_line:(*EncodedCommand* OR *FromBase64String*)
AND process.parent.name:(winword.exe OR excel.exe OR powerpnt.exe)
AND @timestamp >= now-24h`;

  const labelStyle = {
    display: "block",
    fontSize: 12,
    fontWeight: 700,
    color: BRAND.ink.body,
    marginBottom: 7,
  };

  const controlStyle = {
    width: "100%",
    minHeight: 42,
    borderRadius: 8,
    border: `1px solid ${BRAND.surface.border}`,
    background: BRAND.surface.card,
    color: BRAND.ink.body,
    padding: "9px 11px",
    fontSize: 14,
    outline: "none",
    boxShadow: "0 1px 0 rgba(15,23,42,0.02)",
  };

  const helperStyle = {
    fontSize: 12,
    color: BRAND.ink.subtle,
    lineHeight: 1.5,
    marginTop: 6,
  };

  const Badge = ({ label, map = severityStyles }) => {
    const s = map[label] || severityStyles.Info;
    return (
      <span className="inline-flex items-center rounded-full px-2.5 py-1" style={{ background: s.bg, color: s.fg, border: `1px solid ${s.border}`, fontSize: 12, fontWeight: 700 }}>
        {label}
      </span>
    );
  };

  const FieldPill = ({ children }) => (
    <span className="inline-flex rounded-md px-2 py-1 font-mono" style={{ background: BRAND.surface.canvas, color: BRAND.ink.muted, border: `1px solid ${BRAND.surface.border}`, fontSize: 11 }}>
      {children}
    </span>
  );

  return (
    <div className="space-y-12">
      <section>
        <SectionEyebrow number="27" label="AI SOC Product Language" />
        <div
          className="relative overflow-hidden rounded-2xl"
          style={{
            background: `radial-gradient(80% 70% at 84% 10%, ${BRAND.dark.navyAccent} 0%, ${BRAND.dark.navy} 56%, ${BRAND.dark.navyDeep} 100%)`,
            border: `1px solid ${BRAND.dark.navyAccent}`,
          }}
        >
          <div
            className="absolute inset-0 pointer-events-none"
            style={{
              backgroundImage: `linear-gradient(to right, ${BRAND.primary[500]} 1px, transparent 1px), linear-gradient(to bottom, ${BRAND.primary[500]} 1px, transparent 1px)`,
              backgroundSize: "40px 40px",
              opacity: 0.12,
            }}
          />
          <div className="relative grid xl:grid-cols-[1fr_480px] gap-8 p-6 md:p-8 lg:p-10 items-center">
            <div>
              <div className="font-mono" style={{ fontSize: 11, fontWeight: 700, letterSpacing: "0.2em", color: BRAND.primary[300] }}>
                AI SIEM / THREAT OPERATIONS
              </div>
              <h2 style={{ fontSize: 42, fontWeight: 700, letterSpacing: "-0.025em", color: "#FFFFFF", lineHeight: 1.05, marginTop: 18 }}>
                Show the analyst the incident, the evidence, and the next move.
              </h2>
              <p style={{ fontSize: 15, color: BRAND.dark.slateMuted, lineHeight: 1.65, marginTop: 18, maxWidth: 650 }}>
                BSIO product surfaces should feel like a precise AI SOC console: compact, evidence-linked, mapped to threat behavior, and useful before anyone reads a paragraph.
              </p>
              <div className="grid sm:grid-cols-2 lg:grid-cols-4 gap-3 mt-6">
                {socMetrics.map((m) => (
                  <div key={m.label} className="rounded-lg p-3" style={{ background: "rgba(255,255,255,0.06)", border: `1px solid ${BRAND.dark.navyAccent}` }}>
                    <div className="font-mono" style={{ fontSize: 10, fontWeight: 700, letterSpacing: "0.14em", color: BRAND.dark.slateMuted, textTransform: "uppercase" }}>{m.label}</div>
                    <div style={{ fontSize: 30, fontWeight: 700, color: m.color, marginTop: 7, lineHeight: 1, fontVariantNumeric: "tabular-nums" }}>{m.value}</div>
                    <div style={{ fontSize: 12, color: BRAND.dark.slateMuted, marginTop: 7 }}>{m.detail}</div>
                  </div>
                ))}
              </div>
            </div>

            <div
              style={{
                background: "rgba(255,255,255,0.06)",
                border: `1px solid ${BRAND.dark.navyAccent}`,
                borderRadius: 12,
                overflow: "hidden",
                boxShadow: "0 18px 50px rgba(0,0,0,0.22)",
              }}
            >
              <div className="flex items-center justify-between px-4 py-3" style={{ borderBottom: `1px solid ${BRAND.dark.navyAccent}` }}>
                <span style={{ fontSize: 13, color: "#FFFFFF", fontWeight: 700 }}>AI incident summary</span>
                <span className="font-mono" style={{ fontSize: 11, color: BRAND.primary[300] }}>RISK 91</span>
              </div>
              <div className="p-4 space-y-3">
                <div style={{ fontSize: 18, fontWeight: 700, color: "#FFFFFF", lineHeight: 1.25 }}>
                  Encoded PowerShell launched from Office on FIN-LAP-042
                </div>
                <p style={{ fontSize: 13, color: BRAND.dark.slateMuted, lineHeight: 1.55 }}>
                  The model links an Office child process, encoded command content, and outbound HTTPS to a rare destination within 14 seconds.
                </p>
                <div className="flex flex-wrap gap-2">
                  {["T1059", "T1027", "EDR", "Finance"].map((tag) => (
                    <span key={tag} className="font-mono rounded-md px-2 py-1" style={{ color: BRAND.primary[300], background: "rgba(67,83,255,0.12)", border: `1px solid ${BRAND.dark.navyAccent}`, fontSize: 11, fontWeight: 700 }}>{tag}</span>
                  ))}
                </div>
                <div className="grid grid-cols-2 gap-2 pt-2">
                  {[
                    ["Host", "FIN-LAP-042"],
                    ["User", "mira.chen"],
                    ["Dest IP", "203.0.113.44"],
                    ["Next", "Isolate host"],
                  ].map((item) => (
                    <div key={item[0]} className="rounded-lg px-3 py-2" style={{ background: "rgba(255,255,255,0.05)", border: `1px solid ${BRAND.dark.navyAccent}` }}>
                      <div className="font-mono" style={{ fontSize: 10, color: BRAND.dark.slateMuted, letterSpacing: "0.14em" }}>{item[0]}</div>
                      <div style={{ fontSize: 13, color: "#FFFFFF", fontWeight: 700, marginTop: 4 }}>{item[1]}</div>
                    </div>
                  ))}
                </div>
              </div>
            </div>
          </div>
        </div>

        <div className="grid md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4">
          {languageRules.map((rule, i) => (
            <Card key={rule.label}>
              <div className="font-mono" style={{ fontSize: 11, fontWeight: 700, letterSpacing: "0.16em", color: BRAND.primary[500] }}>
                {String(i + 1).padStart(2, "0")}
              </div>
              <div style={{ fontSize: 15, fontWeight: 700, color: BRAND.ink.body, lineHeight: 1.3, marginTop: 10 }}>{rule.label}</div>
              <p style={{ fontSize: 13, color: BRAND.ink.muted, lineHeight: 1.55, marginTop: 8 }}>{rule.body}</p>
            </Card>
          ))}
        </div>
      </section>

      <section>
        <SectionEyebrow number="28" label="SIEM Alert Queue" />
        <Card padding={0} style={{ overflow: "hidden" }}>
          <div className="px-4 py-3 flex flex-wrap items-center justify-between gap-3" style={{ borderBottom: `1px solid ${BRAND.surface.border}` }}>
            <div>
              <div style={{ fontSize: 15, fontWeight: 700, color: BRAND.ink.body }}>Threat triage queue</div>
              <div style={{ fontSize: 12, color: BRAND.ink.subtle, marginTop: 2 }}>Actual alert rows should include entity, telemetry source, ATT&CK, signal, risk, and action.</div>
            </div>
            <button className="inline-flex items-center gap-2 px-3 py-2 rounded-lg" style={{ background: BRAND.primary[500], color: "#FFFFFF", fontSize: 13, fontWeight: 700 }}>
              Investigate top risk <ChevronRight size={14} strokeWidth={2.25} />
            </button>
          </div>
          <div className="px-4 py-3 flex flex-wrap gap-2" style={{ background: BRAND.surface.canvas, borderBottom: `1px solid ${BRAND.surface.border}` }}>
            {["Severity: Critical + High", "Source: EDR, IdP, Cloud", "Tactic: Execution, Impact", "Status: Open/Triage"].map((item) => (
              <button key={item} className="px-3 py-1.5 rounded-md" style={{ background: BRAND.surface.card, border: `1px solid ${BRAND.surface.border}`, color: BRAND.ink.muted, fontSize: 12, fontWeight: 600 }}>
                {item}
              </button>
            ))}
          </div>
          <div style={{ overflowX: "auto" }}>
            <div className="grid" style={{ gridTemplateColumns: "116px minmax(320px,1.5fr) 110px 125px 150px 110px 88px", minWidth: 1140 }}>
              {["ID", "Alert", "Severity", "Status", "Entity", "ATT&CK", "Risk"].map((h) => (
                <div key={h} style={{ background: BRAND.primary[500], color: "#FFFFFF", padding: "10px 14px", fontSize: 11, fontWeight: 700, letterSpacing: "0.08em", textTransform: "uppercase" }}>{h}</div>
              ))}
              {alertRows.map((row, i) => (
                <React.Fragment key={row.id}>
                  <div style={{ padding: "13px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card, fontSize: 12, color: BRAND.ink.muted, fontWeight: 700 }}>{row.id}</div>
                  <div style={{ padding: "13px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card }}>
                    <div style={{ fontSize: 13, fontWeight: 700, color: BRAND.ink.body }}>{row.title}</div>
                    <div style={{ fontSize: 12, color: BRAND.ink.muted, lineHeight: 1.45, marginTop: 5 }}>{row.signal}</div>
                    <div style={{ fontSize: 12, color: BRAND.primary[700], fontWeight: 700, marginTop: 7 }}>{row.action}</div>
                  </div>
                  <div style={{ padding: "12px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card }}><Badge label={row.severity} /></div>
                  <div style={{ padding: "12px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card }}><Badge label={row.status} map={statusStyles} /></div>
                  <div style={{ padding: "13px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card }}>
                    <div style={{ fontSize: 13, fontWeight: 700, color: BRAND.ink.body }}>{row.entity}</div>
                    <div style={{ fontSize: 12, color: BRAND.ink.subtle, marginTop: 4 }}>{row.user}</div>
                  </div>
                  <div className="font-mono" style={{ padding: "13px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card, fontSize: 12, color: BRAND.primary[700], fontWeight: 700 }}>{row.technique}</div>
                  <div style={{ padding: "13px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card, fontSize: 24, color: row.risk > 90 ? BRAND.semantic.danger : BRAND.primary[500], fontWeight: 700, textAlign: "right", fontVariantNumeric: "tabular-nums" }}>{row.risk}</div>
                </React.Fragment>
              ))}
            </div>
          </div>
        </Card>
      </section>

      <section>
        <SectionEyebrow number="29" label="Investigation Form Controls" />
        <div className="grid lg:grid-cols-[1.1fr_0.9fr] gap-4">
          <Card>
            <div style={{ fontSize: 18, fontWeight: 700, color: BRAND.ink.body }}>Threat hunt setup</div>
            <p style={{ fontSize: 13, color: BRAND.ink.muted, lineHeight: 1.6, marginTop: 8 }}>
              Forms should use real analyst vocabulary and security enums, not generic labels like type, category, or item.
            </p>
            <div className="grid md:grid-cols-2 gap-4 mt-5">
              <div>
                <label style={labelStyle}>Data source</label>
                <select defaultValue="edr" style={controlStyle}>
                  <option value="edr">EDR process events</option>
                  <option value="idp">IdP sign-in logs</option>
                  <option value="netflow">Firewall / NetFlow</option>
                  <option value="cloud">Cloud audit logs</option>
                </select>
                <div style={helperStyle}>Use product and telemetry names analysts recognize.</div>
              </div>
              <div>
                <label style={labelStyle}>ATT&CK technique</label>
                <select defaultValue="t1059" style={controlStyle}>
                  <option value="t1059">T1059 - Command and Scripting Interpreter</option>
                  <option value="t1078">T1078 - Valid Accounts</option>
                  <option value="t1027">T1027 - Obfuscated Files or Information</option>
                  <option value="t1486">T1486 - Data Encrypted for Impact</option>
                </select>
                <div style={helperStyle}>Technique names should appear with IDs.</div>
              </div>
              <div>
                <label style={labelStyle}>Entity</label>
                <input defaultValue="FIN-LAP-042" style={controlStyle} />
                <div style={helperStyle}>Entity inputs accept host, user, service principal, IP, or cloud resource.</div>
              </div>
              <div>
                <label style={labelStyle}>Lookback</label>
                <select defaultValue="24h" style={controlStyle}>
                  <option value="1h">Last 1 hour</option>
                  <option value="24h">Last 24 hours</option>
                  <option value="7d">Last 7 days</option>
                  <option value="30d">Last 30 days</option>
                </select>
                <div style={helperStyle}>Default depends on data cost and investigation urgency.</div>
              </div>
              <div className="md:col-span-2">
                <label style={labelStyle}>Query</label>
                <input defaultValue="user.name:mira.chen AND process.name:powershell.exe" style={{ ...controlStyle, borderColor: BRAND.primary[500], boxShadow: `0 0 0 3px ${BRAND.primary[100]}` }} />
                <div style={helperStyle}>Focused query examples teach the intended data model.</div>
              </div>
            </div>
          </Card>

          <Card>
            <div style={{ fontSize: 18, fontWeight: 700, color: BRAND.ink.body }}>Dropdown content standard</div>
            <div className="space-y-3 mt-5">
              {[
                ["Severity", "Critical, High, Medium, Low, Info"],
                ["Disposition", "True positive, benign admin, duplicate, expected automation"],
                ["Confidence", "High, Medium, Low with model and analyst source separated"],
                ["Entity type", "Host, user, service account, IP, domain, cloud resource"],
                ["Response", "Contain, collect, block, revoke, escalate, suppress"],
              ].map((row) => (
                <div key={row[0]} className="rounded-lg px-3 py-3" style={{ background: BRAND.surface.canvas, border: `1px solid ${BRAND.surface.border}` }}>
                  <div style={{ fontSize: 13, fontWeight: 700, color: BRAND.ink.body }}>{row[0]}</div>
                  <p style={{ fontSize: 12.5, color: BRAND.ink.muted, lineHeight: 1.5, marginTop: 4 }}>{row[1]}</p>
                </div>
              ))}
            </div>
          </Card>
        </div>
      </section>

      <section>
        <SectionEyebrow number="30" label="AI Triage & Response" />
        <div className="grid lg:grid-cols-[1fr_0.9fr] gap-4">
          <Card>
            <div className="flex flex-wrap items-start justify-between gap-3">
              <div>
                <div style={{ fontSize: 18, fontWeight: 700, color: BRAND.ink.body }}>AI rationale panel</div>
                <p style={{ fontSize: 13, color: BRAND.ink.muted, lineHeight: 1.6, marginTop: 8 }}>
                  AI content is useful when it gives the analyst a cited reason, a guardrail, and a next action.
                </p>
              </div>
              <Badge label="High" />
            </div>
            <div className="space-y-3 mt-5">
              {aiEvidence.map((item) => (
                <div key={item.label} className="rounded-lg p-4" style={{ background: BRAND.surface.canvas, border: `1px solid ${BRAND.surface.border}` }}>
                  <div className="flex flex-wrap items-center gap-2">
                    <span style={{ fontSize: 13, fontWeight: 700, color: BRAND.ink.body }}>{item.label}</span>
                    <FieldPill>{item.evidence.split(",")[0]}</FieldPill>
                  </div>
                  <div style={{ fontSize: 14, color: BRAND.ink.body, lineHeight: 1.5, marginTop: 8 }}>{item.value}</div>
                  <p className="font-mono" style={{ fontSize: 11, color: BRAND.ink.subtle, lineHeight: 1.5, marginTop: 8 }}>{item.evidence}</p>
                </div>
              ))}
            </div>
          </Card>

          <Card>
            <div style={{ fontSize: 18, fontWeight: 700, color: BRAND.ink.body }}>Response playbook specimen</div>
            <div className="space-y-4 mt-5">
              {responseSteps.map((step) => (
                <div key={step[0]} className="flex gap-3">
                  <span className="font-mono shrink-0" style={{ fontSize: 13, fontWeight: 700, color: BRAND.primary[500], minWidth: 28 }}>{step[0]}</span>
                  <div>
                    <div style={{ fontSize: 14, fontWeight: 700, color: BRAND.ink.body }}>{step[1]}</div>
                    <p style={{ fontSize: 12.5, color: BRAND.ink.muted, lineHeight: 1.5, marginTop: 4 }}>{step[2]}</p>
                  </div>
                </div>
              ))}
            </div>
            <div className="mt-5 p-4 rounded-lg" style={{ background: BRAND.surface.callout, borderLeft: `4px solid ${BRAND.primary[500]}` }}>
              <div style={{ fontSize: 13, color: BRAND.ink.body, lineHeight: 1.6 }}>
                <strong style={{ color: BRAND.primary[700] }}>Useful AI output.</strong> Show confidence, evidence, uncertainty, and an action that can be accepted or rejected.
              </div>
            </div>
          </Card>
        </div>
      </section>

      <section>
        <SectionEyebrow number="31" label="Security Data Fields" />
        <div className="grid xl:grid-cols-[1.15fr_0.85fr] gap-4">
          <Card padding={0} style={{ overflow: "hidden" }}>
            <div className="px-4 py-3" style={{ borderBottom: `1px solid ${BRAND.surface.border}` }}>
              <div style={{ fontSize: 15, fontWeight: 700, color: BRAND.ink.body }}>Field dictionary example</div>
              <div style={{ fontSize: 12, color: BRAND.ink.subtle, marginTop: 2 }}>Use this level of specificity when designing filters, tables, details panels, and exports.</div>
            </div>
            <div style={{ overflowX: "auto" }}>
              <div className="grid" style={{ gridTemplateColumns: "180px 210px minmax(280px,1fr)", minWidth: 760 }}>
                {["Field", "Example value", "Why it matters"].map((h) => (
                  <div key={h} style={{ background: BRAND.primary[500], color: "#FFFFFF", padding: "10px 14px", fontSize: 11, fontWeight: 700, letterSpacing: "0.08em", textTransform: "uppercase" }}>{h}</div>
                ))}
                {fieldRows.map((row, i) => (
                  <React.Fragment key={row[0]}>
                    <div className="font-mono" style={{ padding: "11px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card, fontSize: 12, color: BRAND.primary[700], fontWeight: 700 }}>{row[0]}</div>
                    <div className="font-mono" style={{ padding: "11px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card, fontSize: 12, color: BRAND.ink.body }}>{row[1]}</div>
                    <div style={{ padding: "11px 14px", borderTop: `1px solid ${BRAND.surface.border}`, background: i % 2 ? BRAND.surface.callout : BRAND.surface.card, fontSize: 12.5, color: BRAND.ink.muted, lineHeight: 1.45 }}>{row[2]}</div>
                  </React.Fragment>
                ))}
              </div>
            </div>
          </Card>

          <div className="space-y-4">
            <CodeBlock label="SIEM / HUNT QUERY" code={huntQuery} />
            <CodeBlock label="RAW EVENT / ECS-LIKE JSON" code={rawEvent} />
          </div>
        </div>
      </section>

      <section>
        <SectionEyebrow number="32" label="Detection Content" />
        <div className="grid xl:grid-cols-[0.9fr_1.1fr] gap-4">
          <Card>
            <div style={{ fontSize: 18, fontWeight: 700, color: BRAND.ink.body }}>Detection rule card</div>
            <p style={{ fontSize: 13, color: BRAND.ink.muted, lineHeight: 1.6, marginTop: 8 }}>
              Rule surfaces should show what the detection watches, which data source it needs, what it maps to, and how to tune false positives.
            </p>
            <div className="grid sm:grid-cols-2 gap-3 mt-5">
              {[
                ["Rule", "Encoded PowerShell From Office"],
                ["Log source", "windows / process_creation"],
                ["Required fields", "ParentImage, Image, CommandLine, User, Computer"],
                ["ATT&CK", "T1059, T1027"],
                ["Level", "High"],
                ["False positives", "Approved macro administration scripts"],
              ].map((item) => (
                <div key={item[0]} className="rounded-lg p-3" style={{ background: BRAND.surface.canvas, border: `1px solid ${BRAND.surface.border}` }}>
                  <div className="font-mono" style={{ fontSize: 10, color: BRAND.primary[500], fontWeight: 700, letterSpacing: "0.14em", textTransform: "uppercase" }}>{item[0]}</div>
                  <div style={{ fontSize: 13, fontWeight: 700, color: BRAND.ink.body, lineHeight: 1.35, marginTop: 7 }}>{item[1]}</div>
                </div>
              ))}
            </div>
          </Card>
          <CodeBlock label="SIGMA / ENCODED POWERSHELL FROM OFFICE" code={sigmaRule} />
        </div>
      </section>
    </div>
  );
};

window.ProductUITab = ProductUITab;
