:root {
  --bg: #050914;
  --bg-2: #071120;
  --panel: rgba(11, 19, 36, 0.78);
  --panel-2: rgba(18, 29, 51, 0.78);
  --line: rgba(113, 156, 255, 0.18);
  --line-2: rgba(87, 238, 255, 0.2);
  --text: #eef4ff;
  --muted: #96a7cf;
  --accent: #55f2ff;
  --accent-2: #7a7bff;
  --good: #69f3b0;
  --warn: #ffd166;
  --bad: #ff6f91;
  --shadow: 0 24px 80px rgba(0,0,0,0.45);
  --radius: 24px;
  --radius-sm: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(74, 86, 255, 0.17), transparent 34%),
    radial-gradient(circle at 85% 25%, rgba(0, 229, 255, 0.16), transparent 26%),
    radial-gradient(circle at 70% 85%, rgba(79, 216, 173, 0.14), transparent 20%),
    linear-gradient(180deg, #040813 0%, #071120 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image:
    linear-gradient(rgba(92, 117, 188, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 117, 188, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(255,255,255,0.5), transparent 85%);
}
body::after {
  background: radial-gradient(circle at center, transparent 45%, rgba(0,0,0,0.25) 100%);
}

.ambient {
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(45px);
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}
.ambient-a { top: -8vw; left: -6vw; background: radial-gradient(circle, rgba(78,116,255,0.65), transparent 65%); }
.ambient-b { bottom: -12vw; right: -5vw; background: radial-gradient(circle, rgba(46,230,255,0.65), transparent 65%); animation-duration: 22s; }

@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(4vw, 3vw, 0) scale(1.1); }
}

.topbar, main, .modal, .approval-sheet, .toast-region { position: relative; z-index: 1; }
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(5, 10, 20, 0.5);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
.brand strong { display: block; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px;
  position: relative;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(39, 210, 255, 0.24), rgba(114, 109, 255, 0.18));
  border: 1px solid rgba(93, 228, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 36px rgba(18, 65, 130, 0.32);
  transform-style: preserve-3d;
}
.brand-mark span {
  position: absolute; border-radius: 999px; border: 2px solid rgba(93, 228, 255, 0.75); mix-blend-mode: screen;
}
.brand-mark span:nth-child(1){ width: 26px; height: 26px; transform: rotate(0deg) translateZ(10px); }
.brand-mark span:nth-child(2){ width: 32px; height: 18px; transform: rotate(60deg) translateZ(16px); }
.brand-mark span:nth-child(3){ width: 18px; height: 32px; transform: rotate(-60deg) translateZ(12px); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.status-pill, .button, .tab, .live-chip, .posture-label, .metric, .glass-card, .approval-card, .toast {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(13, 18, 34, 0.76); color: var(--muted); font-size: 0.95rem;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 6px rgba(255,209,102,0.14); }
.status-pill.ok .status-dot { background: var(--good); box-shadow: 0 0 0 6px rgba(105,243,176,0.14); }
.button {
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(20, 31, 57, 0.86), rgba(9, 16, 31, 0.92));
  color: var(--text);
  padding: 11px 16px;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 28px rgba(0,0,0,0.2);
}
.button:hover, .tab:hover, .icon-button:hover { transform: translateY(-1px); border-color: rgba(85, 242, 255, 0.34); }
.button:active, .tab:active, .icon-button:active { transform: translateY(0); }
.button-secondary { background: linear-gradient(180deg, rgba(33, 46, 77, 0.85), rgba(12, 20, 39, 0.95)); }
.button-ghost { background: rgba(11, 18, 34, 0.45); }
.button-primary { background: linear-gradient(135deg, rgba(42, 207, 255, 0.95), rgba(108, 112, 255, 0.9)); color: #06101d; font-weight: 700; }
.button.warn { color: #251400; background: linear-gradient(135deg, #ffd166, #ffbe55); }
.button.bad { color: white; background: linear-gradient(135deg, #ff7c95, #ff5c76); }
.button.small { padding: 9px 12px; font-size: 0.92rem; }
.button .count, .tab-badge {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.35rem; border-radius: 999px;
  background: rgba(255,255,255,0.11); margin-left: 8px; font-size: 0.84rem;
}

main { width: min(1320px, calc(100% - 32px)); margin: 26px auto 48px; display: grid; gap: 24px; }
.hero-shell, .exposure-shell, .workspace-shell, .tabs, .modal > div, .approval-card, .glass-card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(12, 20, 39, 0.88), rgba(8, 14, 28, 0.8));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow);
}
.hero-shell, .exposure-shell, .workspace-shell {
  border-radius: 28px;
  overflow: hidden;
}
.hero-shell {
  display: grid;
  grid-template-columns: 1.1fr 360px;
  gap: 22px;
  padding: 28px;
  transform-style: preserve-3d;
}
.hero-shell::before,
.exposure-shell::before,
.workspace-shell::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 18%, transparent 82%, rgba(85,242,255,0.08));
  pointer-events: none;
}
.hero-copy, .score-stage, .metric-rack { position: relative; z-index: 1; }
.hero-copy { padding-right: 18px; }
.eyebrow {
  margin: 0 0 12px; color: #81a1e8; font-size: 0.8rem; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 700;
}
.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 12ch;
}
.hero-copy h1 span {
  background: linear-gradient(135deg, #7af7ff, #91b3ff 42%, #c4d6ff 65%, #7effc7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-summary {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}
.prompt-card {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(17, 28, 50, 0.78), rgba(8, 14, 27, 0.78));
  border: 1px solid rgba(114, 221, 255, 0.18);
  transform: translateZ(15px);
}
.prompt-card span { display: block; font-weight: 700; }
.prompt-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.prompt-icon {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; font-size: 1.5rem;
  background: radial-gradient(circle at 35% 35%, rgba(122, 247, 255, 0.45), rgba(64, 78, 255, 0.18));
  border: 1px solid rgba(122, 247, 255, 0.28);
  box-shadow: 0 10px 28px rgba(49, 103, 216, 0.28);
}

.score-stage {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
}
.score-ring {
  width: 248px;
  height: 248px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at center, rgba(9, 15, 29, 0.96) 0 39%, transparent 40%),
    radial-gradient(circle at center, rgba(65, 232, 255, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(17, 26, 47, 0.78), rgba(8, 13, 28, 0.86));
  display: grid;
  place-items: center;
  position: relative;
  transform-style: preserve-3d;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 240ms ease, box-shadow 240ms ease;
}
.score-ring:hover { transform: translateY(-4px) rotateX(8deg) rotateY(-10deg); box-shadow: 0 42px 90px rgba(0,0,0,0.55); }
.score-ring::before, .score-ring::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(110, 217, 255, 0.12); animation: spin 16s linear infinite;
}
.score-ring::after { inset: -22px; border-style: dashed; opacity: 0.6; animation-duration: 24s; animation-direction: reverse; }
.score-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.score-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8; }
.score-arc { fill: none; stroke: url(#scoreGradient); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 364.42; stroke-dashoffset: 364.42; filter: drop-shadow(0 0 10px rgba(85,242,255,0.45)); transition: stroke-dashoffset 500ms cubic-bezier(.2,.8,.2,1); }
.score-content { position: relative; display: grid; gap: 2px; transform: translateZ(26px); }
.score-content strong { font-size: 4.15rem; line-height: 1; letter-spacing: -0.05em; }
.score-content span { justify-self: center; color: #b9caf2; font-size: 1.05rem; }
.score-content small { justify-self: center; color: var(--muted); font-size: 0.95rem; margin-top: 6px; }
.score-caption { color: var(--muted); font-size: 1rem; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.metric-rack {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.metric {
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(16, 25, 46, 0.78), rgba(9, 15, 29, 0.78));
  border: 1px solid rgba(255,255,255,0.08);
  transform-style: preserve-3d;
}
.metric span { display: block; color: var(--muted); font-size: 0.92rem; }
.metric strong { display: block; font-size: 2.15rem; margin-top: 10px; letter-spacing: -0.04em; }
.metric small { display: block; color: #bfd0ff; margin-top: 8px; }

.exposure-shell { padding: 26px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2, .rail-head h2, .modal-head h2 { margin: 0; font-size: 1.4rem; }
.posture-label, .live-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 9px 14px; color: #d5ecff; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
.live-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 6px rgba(105,243,176,0.14); }
.exposure-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.exposure-card {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 16px;
  background: linear-gradient(180deg, rgba(16, 25, 46, 0.82), rgba(9, 15, 29, 0.82));
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 138px;
  transform-style: preserve-3d;
}
.exposure-card::after {
  content: ""; position: absolute; inset: auto -20% -45% auto; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%); transform: translateZ(20px);
}
.exposure-card h3 { margin: 0 0 10px; font-size: 1rem; }
.exposure-card strong { display: block; font-size: 2.35rem; line-height: 1; letter-spacing: -0.04em; }
.exposure-card p { margin: 10px 0 0; color: var(--muted); line-height: 1.45; font-size: 0.92rem; }
.risk-glow-high { box-shadow: inset 0 0 0 1px rgba(255,111,145,0.22), 0 20px 50px rgba(255,111,145,0.1); }
.risk-glow-med { box-shadow: inset 0 0 0 1px rgba(255,209,102,0.18), 0 20px 50px rgba(255,209,102,0.06); }
.risk-glow-low { box-shadow: inset 0 0 0 1px rgba(105,243,176,0.18), 0 20px 50px rgba(105,243,176,0.06); }

.tabs {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 10px; border-radius: 20px;
}
.tab {
  padding: 12px 16px; border-radius: 14px; cursor: pointer; font: inherit; color: var(--muted);
  background: rgba(13, 18, 34, 0.62); border: 1px solid rgba(255,255,255,0.06);
}
.tab.active { background: linear-gradient(135deg, rgba(32,197,255,0.2), rgba(107,113,255,0.18)); color: white; border-color: rgba(85,242,255,0.25); }
.hidden { display: none !important; }

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0;
  overflow: hidden;
}
.workspace { padding: 24px; display: grid; gap: 18px; }
.activity-rail { padding: 24px; border-left: 1px solid rgba(255,255,255,0.06); background: rgba(5, 10, 22, 0.4); }
.rail-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.activity-list { display: grid; gap: 12px; max-height: 900px; overflow: auto; padding-right: 4px; }
.activity-item, .audit-item, .list-card, .approval-card, .score-factor, .tool-item, .overview-card {
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(16, 25, 46, 0.78), rgba(9, 15, 29, 0.78));
  border: 1px solid rgba(255,255,255,0.08);
}
.activity-meta, .audit-meta {
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.84rem; margin-bottom: 8px;
}
.pill-source, .risk-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.pill-source.agent { background: rgba(85,242,255,0.12); color: #a6f8ff; }
.pill-source.human { background: rgba(255,209,102,0.12); color: #ffd77f; }
.pill-source.system { background: rgba(170,188,255,0.12); color: #c4d6ff; }
.risk-pill.high { background: rgba(255,111,145,0.12); color: #ff9cb0; }
.risk-pill.medium { background: rgba(255,209,102,0.12); color: #ffd77f; }
.risk-pill.low { background: rgba(105,243,176,0.12); color: #9af8c8; }
.activity-item p, .audit-item p, .list-card p, .overview-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.activity-item strong, .audit-item strong, .list-card strong, .overview-card strong { display: block; margin-bottom: 6px; font-size: 1.02rem; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.list-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #c6daff; }
.kv { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; color: var(--muted); font-size: 0.92rem; }
.kv span { display: inline-flex; align-items: center; gap: 6px; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.mini-stat { border-radius: 16px; padding: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05); }
.mini-stat span { display: block; color: var(--muted); font-size: 0.82rem; }
.mini-stat strong { display: block; margin-top: 6px; font-size: 1.45rem; }

.modal {
  border: none;
  padding: 0;
  background: transparent;
  width: min(860px, calc(100% - 24px));
}
.modal::backdrop { background: rgba(4,8,19,0.72); backdrop-filter: blur(10px); }
.modal > div, .modal { border-radius: 28px; }
.modal-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; padding: 24px 24px 0; }
.modal-head p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.icon-button { width: 42px; height: 42px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: white; cursor: pointer; font-size: 1.4rem; }
.tools-list, .score-factors { padding: 18px 24px 24px; display: grid; gap: 12px; }
.tool-item header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tool-item code { color: #b3e2ff; font-size: 0.95rem; }

.approval-sheet {
  position: fixed; right: 18px; bottom: 18px; display: grid; gap: 12px; width: min(420px, calc(100vw - 32px)); z-index: 8;
}
.approval-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.approval-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.approval-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.approval-empty { color: var(--muted); padding: 12px 4px 0; }

.toast-region { position: fixed; left: 18px; bottom: 18px; display: grid; gap: 12px; width: min(360px, calc(100vw - 32px)); z-index: 8; }
.toast {
  border-radius: 18px; padding: 14px 16px; background: rgba(12,18,34,0.84); border: 1px solid rgba(255,255,255,0.08); box-shadow: var(--shadow); animation: toastIn 260ms ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast strong { display: block; margin-bottom: 6px; }
.toast p { margin: 0; color: var(--muted); }

.tilt {
  transition: transform 180ms ease, box-shadow 180ms ease;
  transform-style: preserve-3d;
}
.tilt:hover { box-shadow: 0 26px 70px rgba(0,0,0,0.35); }
.z1{ transform: translateZ(14px); }
.z2{ transform: translateZ(24px); }

@media (max-width: 1100px) {
  .hero-shell { grid-template-columns: 1fr; }
  .score-stage { order: -1; }
  .workspace-shell { grid-template-columns: 1fr; }
  .activity-rail { border-left: none; border-top: 1px solid rgba(255,255,255,0.06); }
  .exposure-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .topbar { padding: 16px; }
  main { width: min(100% - 16px, 1320px); margin-top: 16px; }
  .hero-shell, .exposure-shell, .workspace-shell, .tabs { padding-left: 16px; padding-right: 16px; }
  .hero-shell, .exposure-shell { padding-top: 20px; padding-bottom: 20px; }
  .workspace { padding: 16px; }
  .activity-rail { padding: 16px; }
  .metric-rack, .overview-grid, .mini-grid, .exposure-map { grid-template-columns: 1fr; }
  .button, .tab { width: 100%; justify-content: center; }
  .header-actions { width: 100%; }
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .score-ring { width: 220px; height: 220px; }
  .hero-copy h1 { max-width: 100%; }
}

select {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(7, 13, 27, 0.9);
  color: var(--text);
  padding: 0 36px 0 12px;
  font: inherit;
  outline: none;
}
select:focus-visible { border-color: rgba(85,242,255,0.5); box-shadow: 0 0 0 3px rgba(85,242,255,0.1); }
button:disabled, select:disabled { opacity: 0.42; cursor: not-allowed; transform: none !important; }

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