@import url("./glass-tokens.css");

:root {
  --shell-width: min(1420px, calc(100% - 32px));
  --shell-panel: rgba(8, 10, 14, 0.96);
  --shell-panel-strong: rgba(5, 7, 10, 0.98);
  --shell-line: rgba(255, 255, 255, 0.06);
  --shell-line-strong: rgba(142, 184, 234, 0.2);
  --shell-grid: rgba(255, 255, 255, 0.028);
  --shell-grid-strong: rgba(255, 255, 255, 0.045);
  --shell-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  --shell-radius: 18px;
  --shell-radius-sm: 12px;
  --shell-accent: var(--accent-soft);
  --shell-accent-deep: var(--accent-deep);
  --shell-ok: var(--ok);
  --shell-warn: var(--warn);
  --shell-danger: var(--danger);
  --shell-text: var(--ink);
  --shell-muted: var(--muted);
  --shell-muted-strong: var(--muted-strong);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body.hg-page {
  color: var(--shell-text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 50% 0%, rgba(92, 159, 216, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(92, 159, 216, 0.08) 0%, transparent 30%),
    linear-gradient(180deg, #040507 0%, #070a0f 34%, #050608 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.hg-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 22%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.75) 60%, transparent 100%);
  opacity: 0.8;
}

body.hg-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.02) 48%, transparent 52%);
  background-size: 100% 180px;
  animation: hg-scan 14s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.14;
}

@keyframes hg-scan {
  from { transform: translateY(-16%); }
  to { transform: translateY(16%); }
}

body[data-motion="reduce"]::after,
body[data-motion="reduce"] .hg-shell-scan {
  animation: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--shell-text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(92, 159, 216, 0.28);
  color: var(--shell-text);
}

body[data-motion="reduce"] * {
  scroll-behavior: auto !important;
}

body.hg-home .ops-bg-grid,
body.hg-home .ops-bg-rain,
body.hg-home .ops-bg-scan,
body.hg-home .ops-bg-glow,
body.hg-platform .hg-particle-stack,
body.hg-platform .hg-scanline,
body.hg-dashboard .dash-bg-grid,
body.hg-dashboard .dash-bg-glow {
  display: none !important;
}

.hg-shell-surface {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hg-shell-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
}

.hg-shell-noise {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.035) 0.42px, transparent 0.42px);
  background-size: 4px 4px;
  opacity: 0.28;
  mix-blend-mode: soft-light;
}

.hg-shell-glow {
  position: absolute;
  inset: auto;
  width: 44vw;
  height: 44vw;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.16;
  background: radial-gradient(circle, rgba(92, 159, 216, 0.78) 0%, rgba(92, 159, 216, 0.12) 38%, transparent 72%);
}

.hg-shell-glow--a {
  top: -12vw;
  right: -12vw;
}

.hg-shell-glow--b {
  bottom: -20vw;
  left: -16vw;
  opacity: 0.1;
}

.hg-shell-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(4, 6, 9, 0.86);
  backdrop-filter: blur(18px);
}

.hg-shell-topbar__inner {
  width: var(--shell-width);
  margin: 0 auto;
  padding: 16px 0 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hg-shell-brand {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hg-shell-brandline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-shell-wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.9rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-text);
}

.hg-shell-kicker {
  color: var(--shell-accent);
}

.hg-shell-tagline {
  max-width: 72ch;
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.hg-ascii-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.55;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-muted);
  white-space: pre-wrap;
}

.hg-ascii-note--soft {
  color: var(--shell-muted-strong);
}

body.hg-page .ops-brand h1.hg-shell-wordmark,
body.hg-page .hero-copy h1.hg-hero__title,
body.hg-page .topbar-title.hg-shell-wordmark,
body.hg-page .brand-name.hg-shell-wordmark,
body.hg-page .mt-title.hg-shell-wordmark {
  font-family: var(--font-display) !important;
  font-size: clamp(1.15rem, 2vw, 1.9rem) !important;
  line-height: 1 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: var(--shell-text) !important;
}

body.hg-page .ops-sub.hg-shell-tagline,
body.hg-page .hero-subtitle.hg-hero__lede,
body.hg-page .topbar-subtitle.hg-shell-tagline {
  font-size: 0.94rem !important;
  line-height: 1.6 !important;
  color: var(--ink-secondary) !important;
}

body.hg-page .ops-pill.hg-shell-kicker,
body.hg-page .eyebrow.hg-hero__eyebrow,
body.hg-page .hg-topbar-sub.hg-shell-kicker {
  font-family: var(--font-mono) !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  color: var(--shell-accent) !important;
}

.hg-shell-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.hg-shell-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--shell-muted-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hg-shell-nav a small {
  font-size: 0.56rem;
  color: var(--shell-muted);
  letter-spacing: 0.16em;
}

.hg-shell-nav a.is-active,
.hg-shell-nav a[aria-current="page"] {
  border-color: rgba(142, 184, 234, 0.4);
  background: rgba(92, 159, 216, 0.12);
  color: var(--shell-text);
}

.hg-shell-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hg-shell-chip,
.hg-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-shell-chip strong,
.hg-chip strong {
  color: var(--shell-text);
}

.hg-shell-main {
  position: relative;
  z-index: 2;
  width: var(--shell-width);
  margin: 0 auto;
  padding: 18px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hg-shell-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hg-panel,
.hg-rail-card,
.hg-ascii-shell,
.hg-sidebar,
.hg-screen-shell {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--shell-radius);
  background: linear-gradient(180deg, rgba(9, 12, 18, 0.96) 0%, rgba(5, 7, 10, 0.98) 100%);
  box-shadow: var(--shell-shadow);
  overflow: hidden;
}

.hg-panel::before,
.hg-rail-card::before,
.hg-ascii-shell::before,
.hg-sidebar::before,
.hg-screen-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 16%),
    radial-gradient(circle at 0% 0%, rgba(142, 184, 234, 0.06) 0%, transparent 42%);
  mix-blend-mode: screen;
}

.hg-panel__head,
.hg-rail-head,
.hg-screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.hg-panel__kicker,
.hg-section-kicker,
.hg-rail-kicker,
.hg-screen-kicker {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-accent);
}

.hg-panel__title,
.hg-section-title,
.hg-rail-title,
.hg-screen-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.6rem);
  letter-spacing: 0.02em;
  color: var(--shell-text);
}

.hg-panel__sub,
.hg-section-subtitle,
.hg-rail-subtitle,
.hg-screen-subtitle {
  margin: 6px 0 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 82ch;
}

.hg-panel__body,
.hg-rail-body,
.hg-screen-body {
  padding: 16px;
}

.hg-panel__foot,
.hg-rail-foot,
.hg-screen-foot {
  padding: 12px 16px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 16px;
  align-items: stretch;
}

.hg-hero__copy {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 18px 18px 20px;
}

.hg-hero__copy > * {
  position: relative;
  z-index: 1;
}

body.hg-home .hg-hero__copy::before,
body.hg-platform .hero-copy.hg-hero__copy::before {
  content: "";
  position: absolute;
  inset: -8% -4% 8% 32%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 48% 40%, rgba(142, 184, 234, 0.16) 0%, transparent 44%),
    repeating-linear-gradient(
      90deg,
      rgba(236, 240, 247, 0.12) 0 1px,
      transparent 1px 10px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 68%);
  -webkit-mask-image:
    radial-gradient(circle at 52% 42%, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.78) 40%, transparent 78%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 92%);
  mask-image:
    radial-gradient(circle at 52% 42%, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.78) 40%, transparent 78%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 92%);
  mix-blend-mode: screen;
  opacity: 0.54;
}

body.hg-home .hg-hero__copy::after,
body.hg-platform .hero-copy.hg-hero__copy::after {
  content: "";
  position: absolute;
  inset: 12% 6% auto auto;
  width: min(38%, 18rem);
  height: min(68%, 24rem);
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 62%);
  filter: blur(18px);
  opacity: 0.4;
}

.hg-hero__eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-accent);
}

.hg-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  color: var(--shell-text);
}

.hg-hero__lede {
  max-width: 62ch;
  margin: 14px 0 0;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  line-height: 1.65;
  color: var(--ink-secondary);
}

.hg-hero__copyline {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--shell-muted);
  text-transform: uppercase;
}

.hg-chip-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hg-chip--accent {
  border-color: rgba(142, 184, 234, 0.35);
  background: rgba(92, 159, 216, 0.1);
  color: var(--shell-text);
}

.hg-ascii-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.hg-ascii-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: var(--ascii-stage-min-height, 320px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(92, 159, 216, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(4, 6, 9, 0.98), rgba(7, 10, 14, 0.98));
}

.hg-ascii-shell[data-ascii-variant="compact"] .hg-ascii-stage {
  min-height: var(--ascii-stage-min-height, 180px);
}

.hg-ascii-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 56% 42%, rgba(142, 184, 234, 0.16) 0%, transparent 38%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.045) 0 1px,
      transparent 1px 8px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 18%, rgba(255, 255, 255, 0.02) 82%, transparent 100%);
  -webkit-mask-image:
    radial-gradient(circle at 58% 44%, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.88) 44%, transparent 86%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 96%);
  mask-image:
    radial-gradient(circle at 58% 44%, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.88) 44%, transparent 86%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 96%);
  mix-blend-mode: screen;
  opacity: 0.62;
}

.hg-ascii-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 12%),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.24) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 0 72px rgba(0, 0, 0, 0.28),
    inset 0 -30px 50px rgba(0, 0, 0, 0.2);
}

.hg-ascii-shell[data-ascii-theme="market"] .hg-ascii-stage {
  background:
    radial-gradient(circle at 48% 46%, rgba(147, 183, 204, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(7, 9, 10, 0.985), rgba(9, 11, 12, 0.99));
}

.hg-ascii-shell[data-ascii-theme="market"] .hg-ascii-stage::before {
  background:
    radial-gradient(circle at 48% 46%, rgba(147, 183, 204, 0.1) 0%, transparent 40%),
    repeating-linear-gradient(
      90deg,
      rgba(214, 225, 227, 0.04) 0 1px,
      transparent 1px 8px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 18%, rgba(196, 154, 88, 0.04) 82%, transparent 100%);
}

.hg-ascii-stage canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.hg-ascii-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: rgba(232, 238, 246, 0.92);
  pointer-events: none;
}

.hg-ascii-meta {
  display: grid;
  gap: 10px;
  padding: 11px 13px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.012) 100%);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-ascii-meta-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hg-ascii-meta strong {
  color: var(--shell-accent);
}

.hg-ascii-shell[data-ascii-theme="market"] .hg-ascii-meta strong {
  color: rgba(255, 199, 120, 0.92);
}

.hg-ascii-detail {
  display: grid;
  gap: 4px;
}

.hg-ascii-detail-label {
  color: var(--shell-accent);
}

.hg-ascii-shell[data-ascii-theme="market"] .hg-ascii-detail-label {
  color: rgba(160, 241, 194, 0.94);
}

.hg-ascii-detail-copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-secondary);
}

.hg-ascii-shell[data-ascii-variant="compact"] .hg-ascii-detail-copy {
  font-size: 0.62rem;
}

.hg-ascii-shell[data-ascii-variant="compact"] .hg-ascii-meta {
  gap: 8px;
  padding: 9px 12px 10px;
}

.hg-grid {
  display: grid;
  gap: 12px;
}

.hg-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hg-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hg-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hg-stat {
  position: relative;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--shell-radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.hg-stat::before {
  content: "+ + +";
  position: absolute;
  inset: 10px 12px auto auto;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  color: rgba(142, 184, 234, 0.26);
  pointer-events: none;
}

.hg-stat__label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-stat__value {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--shell-text);
}

.hg-stat__hint {
  margin: 6px 0 0;
  color: var(--shell-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.hg-table {
  width: 100%;
  border-collapse: collapse;
}

.hg-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--shell-muted);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
}

.hg-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--ink-secondary);
  font-size: 0.84rem;
  vertical-align: top;
}

.hg-table td:first-child {
  color: var(--shell-text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.hg-table tr:hover td {
  background: rgba(92, 159, 216, 0.035);
}

.hg-table .hg-table-number,
.hg-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hg-control-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
}

.hg-control-grid--stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hg-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hg-control label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-input,
.hg-select,
.hg-textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--shell-text);
  caret-color: var(--shell-accent);
}

.hg-input::placeholder,
.hg-textarea::placeholder {
  color: rgba(154, 163, 176, 0.72);
}

.hg-input:focus-visible,
.hg-select:focus-visible,
.hg-textarea:focus-visible,
.hg-button:focus-visible,
.hg-shell-nav a:focus-visible,
.hg-tab:focus-visible {
  outline: none;
  border-color: rgba(142, 184, 234, 0.34);
  box-shadow: 0 0 0 3px rgba(92, 159, 216, 0.14);
}

.hg-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.55;
}

.hg-button,
.hg-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(142, 184, 234, 0.28);
  background: rgba(92, 159, 216, 0.1);
  color: var(--shell-text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hg-button:hover,
.hg-tab:hover {
  border-color: rgba(142, 184, 234, 0.4);
  background: rgba(92, 159, 216, 0.16);
}

.hg-button--ghost,
.hg-tab--ghost {
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--shell-muted-strong);
}

.hg-button--danger {
  border-color: rgba(224, 112, 112, 0.32);
  background: rgba(224, 112, 112, 0.12);
}

.hg-button--inline {
  min-height: 34px;
  padding: 0 12px;
}

.hg-feed {
  display: grid;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.hg-feed-line {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.hg-feed-line--fresh {
  border-color: rgba(92, 159, 216, 0.22);
  background: rgba(92, 159, 216, 0.08);
}

.hg-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hg-rail-card {
  display: flex;
  flex-direction: column;
}

.hg-rail-body {
  display: grid;
  gap: 12px;
}

.hg-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.hg-list li {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--ink-secondary);
}

.hg-list strong,
.hg-list code {
  color: var(--shell-text);
}

.hg-kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.hg-kv__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-kv__value {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--shell-text);
}

.hg-accordion {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.hg-accordion summary {
  list-style: none;
  padding: 12px 14px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-text);
}

.hg-accordion summary::-webkit-details-marker {
  display: none;
}

.hg-accordion > div,
.hg-accordion p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

body.hg-home .ops-system-ribbon {
  position: relative;
  z-index: 2;
  width: var(--shell-width);
  margin: 0 auto;
  padding: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

body.hg-home .hg-home-shell {
  position: relative;
  z-index: 2;
  width: var(--shell-width);
  margin: 0 auto;
  padding: 16px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.hg-home .ops-topbar.hg-home-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) auto auto;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--shell-radius);
  background: linear-gradient(180deg, rgba(9, 12, 18, 0.96) 0%, rgba(5, 7, 10, 0.98) 100%);
  box-shadow: var(--shell-shadow);
}

body.hg-home .ops-brand.hg-shell-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 8px;
  align-items: start;
}

body.hg-home .ops-brand.hg-shell-brand > :not(.ops-brand-logo) {
  grid-column: 2;
}

body.hg-home .ops-brand.hg-shell-brand .hg-ascii-note {
  margin-top: 2px;
}

body.hg-home .ops-brand-logo.hg-home-brandmark {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: clamp(40px, 4vw, 48px);
  height: clamp(48px, 4.8vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  flex-shrink: 0;
  overflow: visible;
}

body.hg-home .ops-brand-logo.hg-home-brandmark img {
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  object-fit: contain;
}

body.hg-home .ops-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

body.hg-home .ops-hero-tags li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-muted-strong);
}

body.hg-home .ops-primary-nav.hg-shell-nav {
  justify-content: flex-end;
  align-self: start;
}

body.hg-home .ops-status-stack.hg-shell-meta {
  justify-content: flex-end;
  align-self: start;
}

body.hg-home .hg-home-fact-grid {
  margin-top: 18px;
}

body.hg-home .ops-command-deck.hg-home-command-deck,
body.hg-home .ops-health,
body.hg-home .ops-role-kpis {
  align-items: stretch;
}

body.hg-home .ops-main.hg-home-mainstack,
body.hg-home .ops-rail.hg-home-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

body.hg-home .ops-shell.hg-home-main {
  display: grid;
  grid-template-columns: minmax(250px, 0.76fr) minmax(0, 1.24fr);
  gap: 16px;
  align-items: start;
}

body.hg-home .rail-card.hg-rail-card {
  padding: 16px;
}

body.hg-home .rail-card.hg-rail-card h2,
body.hg-home .signal-grid article strong,
body.hg-home .contract-grid article h3,
body.hg-home .status-tile h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: var(--shell-text);
}

body.hg-home .rail-card.hg-rail-card ol,
body.hg-home .rail-card.hg-rail-card ul,
body.hg-home .dash-bullets {
  margin: 0;
  padding-left: 1.1rem;
}

body.hg-home .rail-card.hg-rail-card li,
body.hg-home .signal-grid article p,
body.hg-home .contract-grid article p,
body.hg-home .status-tile p,
body.hg-home .abstraction-grid article p {
  color: var(--ink-secondary);
  line-height: 1.6;
}

body.hg-home .signal-grid article,
body.hg-home .contract-grid article,
body.hg-home .abstraction-grid article,
body.hg-home .status-tile {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

body.hg-home .panel-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-accent);
}

body.hg-home .panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 2vw, 1.45rem);
  color: var(--shell-text);
}

body.hg-home .ops-link-cluster,
body.hg-home .jump-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.hg-home .ops-access-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
}

body.hg-home .field-inline,
body.hg-home .field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.hg-home .field-inline > span,
body.hg-home .field-block > span {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

body.hg-home input,
body.hg-home select,
body.hg-home textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--shell-text);
  caret-color: var(--shell-accent);
}

body.hg-home input::placeholder,
body.hg-home textarea::placeholder {
  color: rgba(154, 163, 176, 0.72);
}

body.hg-home input:focus-visible,
body.hg-home select:focus-visible,
body.hg-home textarea:focus-visible,
body.hg-home button:focus-visible,
body.hg-home .ops-link-cluster a:focus-visible {
  outline: none;
  border-color: rgba(142, 184, 234, 0.34);
  box-shadow: 0 0 0 3px rgba(92, 159, 216, 0.14);
}

body.hg-home button,
body.hg-home .ops-link-cluster a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(142, 184, 234, 0.28);
  background: rgba(92, 159, 216, 0.1);
  color: var(--shell-text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: none;
  text-decoration: none;
}

body.hg-home button:hover,
body.hg-home .ops-link-cluster a:hover {
  border-color: rgba(142, 184, 234, 0.4);
  background: rgba(92, 159, 216, 0.16);
}

body.hg-home button.ghost,
body.hg-home .ops-link-cluster a,
body.hg-home .jump-actions button {
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--shell-muted-strong);
}

body.hg-home button.ghost:hover,
body.hg-home .ops-link-cluster a:hover,
body.hg-home .jump-actions button:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.hg-home code {
  font-family: var(--font-mono);
  color: var(--shell-text);
  word-break: break-word;
}

body.hg-home .output {
  margin: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow: auto;
}

body.hg-home .output-compact {
  min-height: 120px;
}

body.hg-home .status-tile p,
body.hg-home .health-tile p,
body.hg-home .kpi-tile p {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--shell-text);
}

body.hg-dashboard .dash-screen-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

body.hg-dashboard .dash-screen-body > .kpi-grid,
body.hg-dashboard .dash-screen-body > .data-grid,
body.hg-dashboard .dash-screen-body > .card {
  margin: 0;
}

body.hg-dashboard .dash-card.hg-panel > .dash-table-wrap,
body.hg-dashboard .dash-card.hg-panel > .dash-card-copy,
body.hg-dashboard .dash-card.hg-panel > .dash-ledger-controls {
  padding: 16px;
}

body.hg-dashboard .dash-card.hg-panel > .dash-table-wrap {
  padding-top: 0;
  overflow: auto;
}

body.hg-dashboard .dash-card.hg-panel > .dash-card-copy {
  padding-top: 0;
}

body.hg-dashboard .dash-ledger-controls {
  display: grid;
  gap: 14px;
}

body.hg-dashboard .dash-ledger-note {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--shell-muted);
}

body.hg-dashboard .dash-ledger-note code {
  color: var(--shell-text);
}

body.hg-dashboard .dash-ledger-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

body.hg-dashboard .dash-ledger-form-head {
  display: grid;
  gap: 4px;
}

body.hg-dashboard .dash-ledger-form-head strong,
body.hg-dashboard .dash-ledger-summary-block h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.94rem;
  color: var(--shell-text);
}

body.hg-dashboard .dash-ledger-form-head span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

body.hg-dashboard .dash-ledger-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.hg-dashboard .dash-ledger-field > span {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

body.hg-dashboard .dash-ledger-field--limit {
  max-width: 120px;
}

body.hg-dashboard .dash-ledger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

body.hg-dashboard .dash-ledger-grid {
  align-items: start;
}

body.hg-dashboard .dash-ledger-side-stack {
  display: grid;
  gap: 12px;
}

body.hg-dashboard .dash-ledger-empty,
body.hg-dashboard .dash-ledger-notice,
body.hg-dashboard .dash-ledger-summary-block {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

body.hg-dashboard .dash-ledger-empty strong,
body.hg-dashboard .dash-ledger-notice strong {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.94rem;
  color: var(--shell-text);
}

body.hg-dashboard .dash-ledger-empty p,
body.hg-dashboard .dash-ledger-notice p {
  margin: 6px 0 0;
  color: var(--ink-secondary);
  line-height: 1.6;
}

body.hg-dashboard .dash-ledger-notice--warn {
  border-color: rgba(255, 214, 160, 0.16);
}

body.hg-dashboard .dash-ledger-notice--danger {
  border-color: rgba(255, 155, 138, 0.18);
}

body.hg-dashboard .dash-ledger-primary,
body.hg-dashboard .dash-ledger-secondary {
  display: grid;
  gap: 4px;
}

body.hg-dashboard .dash-ledger-primary small,
body.hg-dashboard .dash-ledger-secondary small,
body.hg-dashboard .dash-ledger-secondary span,
body.hg-dashboard .dash-ledger-trace {
  color: var(--shell-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.5;
}

body.hg-dashboard .dash-ledger-trace-inline {
  display: inline-block;
  max-width: 20ch;
  overflow-wrap: anywhere;
}

body.hg-dashboard .dash-ledger-payload-cell {
  white-space: normal !important;
  max-width: 360px !important;
}

body.hg-dashboard .dash-table tbody tr[data-ledger-event-id] {
  cursor: pointer;
}

body.hg-dashboard .dash-table tbody tr[data-ledger-event-id].is-selected td {
  background: rgba(92, 159, 216, 0.08);
}

body.hg-dashboard .dash-ledger-pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

body.hg-dashboard .dash-ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.hg-dashboard .dash-ledger-stack,
body.hg-dashboard .dash-ledger-kv-grid {
  display: grid;
  gap: 12px;
}

body.hg-dashboard .dash-ledger-kv-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.hg-dashboard .dash-ledger-kv {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

body.hg-dashboard .dash-ledger-kv span {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

body.hg-dashboard .dash-ledger-kv strong {
  color: var(--shell-text);
  overflow-wrap: anywhere;
}

body.hg-dashboard .dash-layout {
  gap: 18px;
  padding: 18px;
  grid-template-columns: minmax(260px, 280px) minmax(0, 1fr);
}

body.hg-dashboard .dash-sidebar.hg-sidebar {
  min-height: calc(100dvh - 36px);
  height: calc(100dvh - 36px);
}

body.hg-dashboard .dash-main {
  min-width: 0;
  gap: 18px;
}

body.hg-dashboard .dash-main > .hg-ascii-shell {
  width: min(100%, 1280px);
  margin: 0 auto;
  flex: 0 0 auto;
}

body.hg-dashboard .dash-main > .hg-ascii-shell[data-ascii-variant="compact"] {
  width: min(100%, 1180px);
}

body.hg-dashboard .dash-topbar.hg-panel {
  min-height: unset;
}

body.hg-dashboard .brand-text.hg-shell-brand {
  gap: 4px;
}

body.hg-dashboard .brand-text .hg-ascii-note,
body.hg-dashboard .topbar-heading .hg-ascii-note {
  margin-top: 2px;
}

body.hg-markets .mt-heading .hg-ascii-note {
  max-width: 48rem;
}

body.hg-dashboard .brand-name.hg-shell-wordmark,
body.hg-dashboard .topbar-title.hg-shell-wordmark {
  font-size: clamp(0.96rem, 1.4vw, 1.22rem) !important;
  letter-spacing: 0.12em !important;
}

body.hg-dashboard .dash-content {
  padding: 0 0 24px;
  background-image: none;
}

body.hg-dashboard .screen {
  max-width: 1280px;
}

body.hg-dashboard .dash-screen-card.hg-panel,
body.hg-dashboard .dash-card.hg-panel {
  padding: 0;
}

body.hg-dashboard .dash-screen-card.hg-panel::before,
body.hg-dashboard .dash-screen-card.hg-panel::after,
body.hg-dashboard .dash-card.hg-panel::before,
body.hg-dashboard .dash-card.hg-panel::after {
  display: none;
}

body.hg-dashboard .dash-screen-card.hg-panel > .card-header,
body.hg-dashboard .dash-card.hg-panel > .card-header {
  margin: 0;
}

body.hg-dashboard .card-subtitle {
  padding: 0 !important;
  border: 0 !important;
  font-family: inherit !important;
  font-size: 0.78rem !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: var(--ink-secondary) !important;
}

body.hg-dashboard .dash-kicker {
  margin: 0;
  align-self: center;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

body.hg-dashboard .dash-bullets {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
  color: var(--ink-secondary);
}

body.hg-dashboard .kpi-card.hg-stat {
  min-height: 100%;
}

body.hg-dashboard .data-grid.hg-grid.data-grid-23 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

body.hg-dashboard .data-grid.hg-grid.data-grid-32 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.hg-section-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-section-rule::before,
.hg-section-rule::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}

.hg-panel > .panel-head,
.hg-panel > .card-header,
.hg-panel > .output-head,
.hg-panel > .section-heading,
.hg-panel > .topbar,
.hg-panel > .sidebar-brand,
.hg-panel > .mt-pane-h,
.hg-panel > .mt-feed-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.hg-panel > .panel-head > div,
.hg-panel > .card-header > div,
.hg-panel > .section-heading > div {
  min-width: 0;
}

.hg-panel > .panel-head h2,
.hg-panel > .card-header h2,
.hg-panel > .section-heading h2,
.hg-panel > .topbar-title,
.hg-panel > .mt-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 0.02em;
  color: var(--shell-text);
}

.hg-panel > .panel-head p,
.hg-panel > .card-header p,
.hg-panel > .section-heading p,
.hg-panel > .mt-note,
.hg-panel > .card-subtitle {
  margin: 6px 0 0;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.hg-panel > .output-head,
.hg-panel > .mt-feed-h {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-accent);
}

.hg-stat > h2,
.hg-stat > .kpi-label,
.hg-stat > .health-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.hg-stat > p,
.hg-stat > .kpi-value,
.hg-stat > .kpi-detail {
  margin: 0;
}

.hg-stat > p:last-child,
.hg-stat > .kpi-detail {
  margin-top: 6px;
  color: var(--shell-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.hg-stat > .kpi-value,
.hg-stat > .health-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--shell-text);
}

.hg-tab.is-active,
.hg-tab[aria-selected="true"] {
  border-color: rgba(142, 184, 234, 0.4);
  background: rgba(92, 159, 216, 0.12);
  color: var(--shell-text);
}

.hg-screen-shell {
  display: flex;
  flex-direction: column;
}

.hg-screen-head .hg-button {
  flex-shrink: 0;
}

.hg-screen-head .hg-shell-chip {
  flex-shrink: 0;
}

.hg-hidden {
  display: none !important;
}

.hg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .hg-hero,
  .hg-control-grid,
  .hg-control-grid--stack,
  .hg-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hg-shell-topbar__inner {
    flex-direction: column;
  }

  .hg-shell-nav {
    justify-content: flex-start;
  }

  body.hg-home .ops-topbar.hg-home-topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.hg-home .ops-status-stack.hg-shell-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .hg-hero,
  .hg-grid--3,
  .hg-grid--2,
  .hg-control-grid,
  .hg-control-grid--stack,
  .hg-grid--4 {
    grid-template-columns: 1fr;
  }

  .hg-shell-main {
    padding-top: 14px;
  }

  .hg-ascii-stage {
    min-height: min(var(--ascii-stage-min-height, 320px), 240px);
  }

  .hg-panel__head,
  .hg-rail-head,
  .hg-screen-head {
    flex-direction: column;
  }

  body.hg-dashboard .dash-main > .hg-ascii-shell {
    width: 100%;
  }

  body.hg-home .ops-topbar.hg-home-topbar,
  body.hg-home .ops-shell.hg-home-main,
  body.hg-home .ops-access-grid,
  body.hg-dashboard .dash-ledger-control-grid,
  body.hg-dashboard .dash-ledger-grid,
  body.hg-dashboard .dash-ledger-summary-grid,
  body.hg-dashboard .dash-ledger-kv-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  body.hg-dashboard .dash-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  body.hg-dashboard .dash-sidebar.hg-sidebar {
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0 18px 18px 0;
  }

  body.hg-dashboard .dash-main {
    gap: 0;
  }

  body.hg-dashboard .dash-topbar.hg-panel {
    border-radius: 0;
  }

  body.hg-dashboard .dash-main > .hg-ascii-shell {
    width: calc(100% - 32px);
    margin: 16px auto 0;
  }

  body.hg-dashboard .dash-content {
    padding: 16px;
  }

  body.hg-dashboard .dash-ledger-actions {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  body.hg-page {
    background-attachment: scroll;
  }

  .hg-shell-topbar__inner,
  .hg-shell-main {
    width: min(100%, calc(100% - 16px));
  }

  .hg-panel__body,
  .hg-rail-body,
  .hg-screen-body {
    padding: 14px;
  }

  .hg-hero__title {
    font-size: clamp(1.8rem, 12vw, 2.8rem);
  }

  .hg-button,
  .hg-tab {
    width: 100%;
  }

  .hg-table thead th,
  .hg-table td {
    padding-inline: 8px;
  }

  body.hg-home .hg-home-shell,
  body.hg-home .ops-system-ribbon {
    width: min(100%, calc(100% - 16px));
  }

  body.hg-home .ops-brand.hg-shell-brand {
    grid-template-columns: 1fr;
  }

  body.hg-home .ops-brand.hg-shell-brand > :not(.ops-brand-logo) {
    grid-column: 1;
  }

  body.hg-home .ops-brand-logo.hg-home-brandmark {
    grid-row: auto;
  }

  .hg-ascii-note {
    font-size: 0.56rem;
    letter-spacing: 0.14em;
  }

  body.hg-home button,
  body.hg-home .ops-link-cluster a {
    width: 100%;
  }

  body.hg-dashboard .dash-screen-body {
    padding: 14px;
  }

  body.hg-dashboard .dash-card.hg-panel > .dash-table-wrap,
  body.hg-dashboard .dash-card.hg-panel > .dash-card-copy,
  body.hg-dashboard .dash-card.hg-panel > .dash-ledger-controls {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hg-page::after {
    display: none;
  }

  .hg-shell-surface * {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* Brand color lift for destination surfaces */

body.hg-page {
  --bg-0: #f8fbff;
  --bg-1: #eff4ff;
  --bg-2: #e6eefc;
  --bg-3: #dae5fb;
  --surface-0: rgba(255, 255, 255, 0.84);
  --surface-1: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(243, 247, 255, 0.94);
  --surface-3: rgba(228, 236, 251, 0.98);
  --ink: #1e2f67;
  --ink-secondary: rgba(30, 47, 103, 0.74);
  --ink-soft: rgba(30, 47, 103, 0.6);
  --muted: rgba(56, 79, 139, 0.6);
  --muted-strong: rgba(30, 47, 103, 0.8);
  --accent: #1e66ff;
  --accent-soft: #2f6fff;
  --accent-deep: #164fd6;
  --accent-glow: rgba(30, 102, 255, 0.22);
  --accent-dim: rgba(30, 102, 255, 0.12);
  --accent-border: rgba(30, 102, 255, 0.24);
  --accent-particle: rgba(30, 102, 255, 0.24);
  --hg-particle-dot: rgba(30, 102, 255, 0.18);
  --hg-particle-faint: rgba(30, 102, 255, 0.12);
  --hg-screen-line: rgba(33, 79, 184, 0.08);
  --line: rgba(33, 79, 184, 0.12);
  --line-soft: rgba(33, 79, 184, 0.08);
  --line-faint: rgba(33, 79, 184, 0.05);
  --glass-1: rgba(255, 255, 255, 0.74);
  --glass-2: rgba(255, 255, 255, 0.82);
  --glass-3: rgba(245, 248, 255, 0.92);
  --glass-border: rgba(33, 79, 184, 0.08);
  --shadow-sm: 0 8px 18px rgba(95, 131, 218, 0.08);
  --shadow-md: 0 14px 36px rgba(95, 131, 218, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.48);
  --shadow-lg: 0 18px 50px rgba(95, 131, 218, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  --shadow-float: 0 24px 70px rgba(95, 131, 218, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.55);
  --ot-cli-bg: rgba(247, 250, 255, 0.92);
  --ot-cli-border: rgba(33, 79, 184, 0.12);
  --ot-cli-text: rgba(30, 47, 103, 0.92);
  --ot-cli-dim: rgba(56, 79, 139, 0.72);
  --ot-cli-accent: #1e66ff;
  --ot-cli-ok: rgba(44, 143, 104, 0.86);
  --ot-cli-grid: rgba(30, 102, 255, 0.05);
  --hg-term-bg0: rgba(255, 255, 255, 0.86);
  --hg-term-bg1: rgba(241, 246, 255, 0.94);
  --hg-term-fg: #1e2f67;
  --hg-term-dim: rgba(56, 79, 139, 0.68);
  --hg-term-accent: #1e66ff;
  --hg-term-ok: #2c8f68;
  --hg-term-warn: #b87b1f;
  --hg-term-err: #c94b6b;
  --hg-term-meta: #4d6db8;
  --hg-term-border: rgba(33, 79, 184, 0.16);
  --shell-panel: rgba(255, 255, 255, 0.84);
  --shell-panel-strong: rgba(255, 255, 255, 0.94);
  --shell-line: rgba(33, 79, 184, 0.12);
  --shell-line-strong: rgba(30, 102, 255, 0.2);
  --shell-grid: rgba(30, 102, 255, 0.05);
  --shell-grid-strong: rgba(30, 102, 255, 0.08);
  --shell-shadow: 0 20px 48px rgba(95, 131, 218, 0.16);
  --shell-accent: var(--accent);
  --shell-accent-deep: var(--accent-deep);
  --shell-text: var(--ink);
  --shell-muted: var(--muted);
  --shell-muted-strong: rgba(30, 47, 103, 0.76);
  color: var(--shell-text);
  background:
    radial-gradient(circle at 18% 18%, rgba(52, 117, 255, 0.12) 0%, rgba(52, 117, 255, 0) 28%),
    radial-gradient(circle at 84% 70%, rgba(78, 122, 239, 0.1) 0%, rgba(78, 122, 239, 0) 26%),
    linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
}

body.hg-page::before {
  background-image:
    linear-gradient(rgba(30, 102, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 102, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: none;
  opacity: 0.48;
}

body.hg-page::after {
  background:
    linear-gradient(180deg, transparent 0%, rgba(30, 102, 255, 0.06) 48%, transparent 52%);
  mix-blend-mode: multiply;
  opacity: 0.12;
}

::selection {
  background: rgba(30, 102, 255, 0.16);
  color: var(--shell-text);
}

.hg-shell-grid {
  background-image:
    linear-gradient(rgba(30, 102, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 102, 255, 0.045) 1px, transparent 1px);
  opacity: 0.34;
}

.hg-shell-noise {
  background-image: radial-gradient(circle, rgba(30, 102, 255, 0.08) 0.42px, transparent 0.42px);
  opacity: 0.16;
  mix-blend-mode: multiply;
}

.hg-shell-glow {
  opacity: 0.24;
  background: radial-gradient(circle, rgba(30, 102, 255, 0.22) 0%, rgba(30, 102, 255, 0.06) 42%, transparent 72%);
}

.hg-shell-topbar {
  border-bottom: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 34px rgba(95, 131, 218, 0.08);
}

.hg-shell-nav a {
  border: 1px solid rgba(33, 79, 184, 0.12);
  background: rgba(255, 255, 255, 0.64);
  color: var(--shell-muted-strong);
  box-shadow: 0 8px 22px rgba(122, 146, 214, 0.06);
}

.hg-shell-nav a small {
  color: var(--shell-muted);
}

.hg-shell-nav a.is-active,
.hg-shell-nav a[aria-current="page"] {
  border-color: rgba(30, 102, 255, 0.22);
  background: rgba(30, 102, 255, 0.08);
  color: var(--shell-accent-deep);
}

.hg-shell-chip,
.hg-chip {
  border: 1px solid rgba(33, 79, 184, 0.1);
  background: rgba(255, 255, 255, 0.64);
  color: var(--shell-muted);
  box-shadow: 0 10px 24px rgba(122, 146, 214, 0.06);
}

.hg-panel,
.hg-rail-card,
.hg-ascii-shell,
.hg-sidebar,
.hg-screen-shell {
  border: 1px solid rgba(33, 79, 184, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(241, 246, 255, 0.86) 100%);
  box-shadow: var(--shell-shadow);
}

.hg-panel::before,
.hg-rail-card::before,
.hg-ascii-shell::before,
.hg-sidebar::before,
.hg-screen-shell::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, transparent 18%),
    radial-gradient(circle at 0% 0%, rgba(30, 102, 255, 0.08) 0%, transparent 44%);
  mix-blend-mode: normal;
}

.hg-panel__head,
.hg-rail-head,
.hg-screen-head {
  border-bottom: 1px solid rgba(33, 79, 184, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(241, 246, 255, 0.2));
}

.hg-panel__foot,
.hg-rail-foot,
.hg-screen-foot {
  border-top: 1px solid rgba(33, 79, 184, 0.08);
}

.hg-ascii-stage {
  background:
    radial-gradient(circle at 50% 42%, rgba(30, 102, 255, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 255, 0.96));
}

.hg-ascii-stage::before {
  background:
    radial-gradient(circle at 56% 42%, rgba(30, 102, 255, 0.12) 0%, transparent 38%),
    repeating-linear-gradient(
      90deg,
      rgba(30, 102, 255, 0.06) 0 1px,
      transparent 1px 8px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 18%, rgba(30, 102, 255, 0.03) 82%, transparent 100%);
  mix-blend-mode: multiply;
}

.hg-ascii-stage::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, transparent 12%),
    linear-gradient(180deg, transparent 0%, rgba(30, 102, 255, 0.04) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(30, 102, 255, 0.08),
    inset 0 0 56px rgba(95, 131, 218, 0.08),
    inset 0 -26px 40px rgba(95, 131, 218, 0.06);
}

.hg-ascii-shell[data-ascii-theme="market"] .hg-ascii-stage {
  background:
    radial-gradient(circle at 48% 46%, rgba(30, 102, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 255, 0.98));
}

.hg-ascii-shell[data-ascii-theme="market"] .hg-ascii-stage::before {
  background:
    radial-gradient(circle at 48% 46%, rgba(30, 102, 255, 0.08) 0%, transparent 40%),
    repeating-linear-gradient(
      90deg,
      rgba(30, 102, 255, 0.045) 0 1px,
      transparent 1px 8px
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, transparent 18%, rgba(184, 123, 31, 0.04) 82%, transparent 100%);
}

.hg-ascii-fallback {
  color: rgba(30, 47, 103, 0.92);
}

.hg-ascii-meta {
  border-top: 1px solid rgba(33, 79, 184, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(241, 246, 255, 0.38) 100%);
}

body.hg-home .ops-topbar.hg-home-topbar {
  border: 1px solid rgba(33, 79, 184, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(241, 246, 255, 0.84) 100%);
  box-shadow: var(--shell-shadow);
}

body.hg-home .ops-hero-tags li,
body.hg-home .signal-grid article,
body.hg-home .contract-grid article,
body.hg-home .abstraction-grid article,
body.hg-home .status-tile {
  border-color: rgba(33, 79, 184, 0.1);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 24px rgba(122, 146, 214, 0.06);
}

body.hg-home input,
body.hg-home select,
body.hg-home textarea {
  border-color: rgba(33, 79, 184, 0.12);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.hg-home input::placeholder,
body.hg-home textarea::placeholder {
  color: rgba(56, 79, 139, 0.54);
}

body.hg-home button,
body.hg-home .ops-link-cluster a {
  border-color: rgba(30, 102, 255, 0.18);
  background: rgba(30, 102, 255, 0.08);
  color: var(--accent-deep);
}

body.hg-home button:hover,
body.hg-home .ops-link-cluster a:hover {
  border-color: rgba(30, 102, 255, 0.3);
  background: rgba(30, 102, 255, 0.14);
}

body.hg-home button.ghost,
body.hg-home .ops-link-cluster a,
body.hg-home .jump-actions button {
  border-color: rgba(33, 79, 184, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: var(--shell-muted-strong);
}

body.hg-home button.ghost:hover,
body.hg-home .ops-link-cluster a:hover,
body.hg-home .jump-actions button:hover {
  background: rgba(30, 102, 255, 0.08);
}

body.hg-home .output {
  border-top: 1px solid rgba(33, 79, 184, 0.08);
  background: rgba(241, 246, 255, 0.68);
}

body.hg-page .hg-terminal-shell {
  border-color: var(--hg-term-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 -10px 36px rgba(95, 131, 218, 0.18);
}

body.hg-page .hg-terminal-bar {
  border-bottom: 1px solid rgba(33, 79, 184, 0.08);
  color: var(--muted-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(239, 244, 255, 0.88) 100%);
}

body.hg-page .hg-terminal-status-pill {
  background: rgba(30, 102, 255, 0.06);
  border-color: rgba(33, 79, 184, 0.12);
}

body.hg-page .hg-terminal-banner {
  color: rgba(44, 143, 104, 0.92);
  border-bottom: 1px solid rgba(44, 143, 104, 0.16);
}

body.hg-page .hg-terminal-code {
  background: rgba(30, 102, 255, 0.08);
  color: var(--accent-deep);
}

body.hg-page .hg-terminal-cols-head {
  border-bottom: 1px solid rgba(33, 79, 184, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

body.hg-page .hg-term-cell.hg-term-channel {
  color: #4d6db8;
}

body.hg-page .hg-term-cell.hg-term-verb {
  color: #2b417f;
}

.hg-panel > .panel-head,
.hg-panel > .card-header,
.hg-panel > .output-head,
.hg-panel > .section-heading,
.hg-panel > .topbar,
.hg-panel > .sidebar-brand,
.hg-panel > .mt-pane-h,
.hg-panel > .mt-feed-h {
  border-bottom: 1px solid rgba(33, 79, 184, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(241, 246, 255, 0.2));
}

.hg-section-rule::before,
.hg-section-rule::after {
  background: linear-gradient(90deg, transparent, rgba(30, 102, 255, 0.14), transparent);
}

body.hg-dashboard .dash-kicker {
  border-color: rgba(33, 79, 184, 0.12);
  background: rgba(30, 102, 255, 0.06);
  color: var(--shell-muted-strong);
}

body.hg-dashboard .dash-ledger-form,
body.hg-dashboard .dash-ledger-empty,
body.hg-dashboard .dash-ledger-notice,
body.hg-dashboard .dash-ledger-summary-block,
body.hg-dashboard .dash-ledger-kv {
  border-color: rgba(33, 79, 184, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(122, 146, 214, 0.06);
}

body.hg-dashboard .dash-table tbody tr[data-ledger-event-id].is-selected td {
  background: rgba(30, 102, 255, 0.08);
}
