/* P6.7.4 — Root-Control CSS Architecture Closure
   Scope contract: every runtime selector is bound to body.root-plane.
   Absolute-control UI remains isolated from Public/Admin/App styling. */
:root {
  color-scheme: dark;
  --xps-root-bg: #050408;
  --xps-root-bg-deep: #100713;
  --xps-root-panel: #120914;
  --xps-root-panel-2: #1b0d18;
  --xps-root-line: rgba(255,120,160,.30);
  --xps-root-line-cool: rgba(49,231,255,.18);
  --xps-root-text: #fff3f7;
  --xps-root-muted: #c8a9b5;
  --xps-root-danger: #ff6b86;
  --xps-root-authority: #ff8fa5;
  --xps-root-primary: #31e7ff;
  --xps-root-ok: #7cffc4;
  --xps-root-warn: #ffd166;
  --xps-root-radius: 28px;
  --xps-root-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --xps-root-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --xps-root-shadow-md: 0 24px 90px rgba(0,0,0,.32);
  --xps-root-shadow-lg: 0 34px 120px rgba(0,0,0,.42);
}

body.root-plane {
  margin: 0;
  min-height: 100vh;
  color: var(--xps-root-text);
  font: 15px/1.55 var(--xps-root-font-sans);
  background:
    radial-gradient(circle at 75% -10%, rgba(255,107,134,.26), transparent 34rem),
    radial-gradient(circle at 0% 48%, rgba(49,231,255,.14), transparent 30rem),
    linear-gradient(180deg, var(--xps-root-bg), var(--xps-root-bg-deep) 56%, var(--xps-root-bg));
}

body.root-plane::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.62), transparent 86%);
}

body.root-plane *,
body.root-plane *::before,
body.root-plane *::after {
  box-sizing: border-box;
}

body.root-plane button,
body.root-plane input {
  font: inherit;
}

body.root-plane .root-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 4vw, 42px) 0 76px;
}

body.root-plane .root-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--xps-root-line);
  border-radius: 36px;
  padding: clamp(26px, 5vw, 54px);
  background: linear-gradient(145deg, rgba(32,13,28,.92), rgba(7,7,16,.80));
  box-shadow: var(--xps-root-shadow-lg);
}

body.root-plane .root-hero::after {
  content: "";
  position: absolute;
  right: -110px;
  top: -120px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255,107,134,.34);
  border-radius: 50%;
  box-shadow: inset 0 0 80px rgba(255,107,134,.12);
}

body.root-plane .root-hero > * {
  position: relative;
  z-index: 1;
}

body.root-plane .eyebrow {
  margin: 0 0 8px;
  color: var(--xps-root-danger);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  font-weight: 950;
}

body.root-plane .root-hero h1 {
  max-width: 1080px;
  margin: 8px 0 18px;
  font-size: clamp(40px, 7vw, 96px);
  line-height: .88;
  letter-spacing: -.075em;
}

body.root-plane .root-hero p {
  max-width: 930px;
  margin: 0;
  color: var(--xps-root-muted);
  font-size: clamp(16px, 1.7vw, 18px);
}

body.root-plane .root-doctrine {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

body.root-plane .root-doctrine span {
  border: 1px solid var(--xps-root-line);
  border-radius: 999px;
  padding: 10px 13px;
  color: #ffe8ef;
  background: rgba(255,107,134,.08);
  font-weight: 900;
}

body.root-plane .root-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

body.root-plane .root-kpi-grid article,
body.root-plane .root-card {
  border: 1px solid var(--xps-root-line);
  border-radius: var(--xps-root-radius);
  background: linear-gradient(180deg, rgba(26,12,23,.82), rgba(12,8,18,.74));
  box-shadow: var(--xps-root-shadow-md);
}

body.root-plane .root-kpi-grid article {
  padding: 18px;
}

body.root-plane .root-kpi-grid small {
  display: block;
  color: var(--xps-root-muted);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 11px;
}

body.root-plane .root-kpi-grid b {
  display: block;
  margin-top: 8px;
  color: var(--xps-root-primary);
  font-size: 24px;
  word-break: break-word;
}

body.root-plane .root-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 18px;
  align-items: start;
}

body.root-plane .root-card {
  min-width: 0;
  padding: 22px;
}

body.root-plane .root-card.danger {
  border-color: rgba(255,107,134,.62);
  background: linear-gradient(180deg, rgba(55,15,30,.82), rgba(14,8,17,.78));
}

body.root-plane .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

body.root-plane .card-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.035em;
}

body.root-plane .card-head span,
body.root-plane .muted {
  color: var(--xps-root-muted);
}

body.root-plane .gate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.root-plane .gate-grid div,
body.root-plane .event-timeline div {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.04);
}

body.root-plane .gate-grid small,
body.root-plane .event-timeline small {
  display: block;
  color: var(--xps-root-muted);
  font-size: 12px;
}

body.root-plane .gate-grid b,
body.root-plane .event-timeline b {
  display: block;
  margin-top: 4px;
  color: var(--xps-root-ok);
  word-break: break-word;
}

body.root-plane .event-timeline {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  margin-bottom: 12px;
}

body.root-plane label {
  display: block;
  margin: 10px 0 6px;
  color: var(--xps-root-muted);
  font-weight: 900;
}

body.root-plane input,
body.root-plane button {
  width: 100%;
  border: 1px solid var(--xps-root-line);
  border-radius: 15px;
  padding: 12px 14px;
  margin-bottom: 10px;
  color: var(--xps-root-text);
  background: rgba(0,0,0,.30);
}

body.root-plane button {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255,107,134,.22), rgba(49,231,255,.08));
  font-weight: 950;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}

body.root-plane button:hover {
  border-color: rgba(255,107,134,.56);
  filter: brightness(1.12);
  transform: translateY(-1px);
}

body.root-plane input:focus {
  border-color: var(--xps-root-authority);
  outline: none;
  box-shadow: 0 0 0 4px rgba(255,107,134,.14);
}

body.root-plane button:focus-visible,
body.root-plane input:focus-visible {
  outline: 2px solid var(--xps-root-authority);
  outline-offset: 3px;
}

body.root-plane pre {
  max-height: 430px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 14px;
  color: #ffe8ef;
  background: rgba(0,0,0,.30);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--xps-root-font-mono);
}

body.root-plane .firewall-note {
  border: 1px dashed rgba(255,107,134,.42);
  border-radius: 18px;
  padding: 14px;
  color: var(--xps-root-muted);
  background: rgba(255,107,134,.08);
}

body.root-plane .firewall-note b {
  color: var(--xps-root-danger);
}

body.root-plane .hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  body.root-plane .root-grid,
  body.root-plane .root-kpi-grid {
    grid-template-columns: 1fr;
  }

  body.root-plane .gate-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body.root-plane .root-shell {
    width: min(100% - 24px, 1440px);
  }

  body.root-plane .root-hero h1 {
    font-size: clamp(40px, 14vw, 58px);
  }

  body.root-plane .card-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.root-plane button {
    transition: none;
  }

  body.root-plane button:hover {
    transform: none;
  }
}
