/* OpenGram /prolevel premium dashboard layer */
:root {
  --premium-bg: #06080d;
  --premium-bg-soft: #0d1420;
  --premium-panel: rgba(16, 23, 35, 0.86);
  --premium-panel-strong: rgba(21, 30, 45, 0.94);
  --premium-line: rgba(244, 211, 143, 0.18);
  --premium-line-strong: rgba(244, 211, 143, 0.34);
  --premium-gold: #f1cf83;
  --premium-gold-deep: #b78a3e;
  --premium-blue: #78aaff;
  --premium-text: #fff7e8;
  --premium-muted: #b8ad9c;
  --premium-faint: #7f8793;
  --premium-radius: 18px;
  --premium-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

html {
  background: var(--premium-bg);
}

html.p404-scroll-page,
body.p404-scroll-page {
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scroll-behavior: smooth;
}

body.p404-scroll-page #app,
body.p404-scroll-page #cp-app,
body.p404-scroll-page #admin-app {
  display: block !important;
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
}

body.p404-scroll-page {
  padding-bottom: 40px;
}

body,
.aw-body,
.ds-body,
#admin-app,
#cp-app {
  background:
    linear-gradient(135deg, rgba(8, 13, 22, 0.98), rgba(6, 8, 13, 0.98)),
    radial-gradient(circle at 15% 0%, rgba(241, 207, 131, 0.14), transparent 36%),
    radial-gradient(circle at 86% 12%, rgba(120, 170, 255, 0.12), transparent 34%) !important;
  color: var(--premium-text);
}

#safety-banner,
.aw-safety-banner,
.ds-safety-banner,
#admin-safety-banner,
#cp-safety-banner,
.aw-safety-labels,
.sf-sticky-badge,
.sf-hero-demo-badge,
.sf-safety-labels,
.sf-section#sf-bridge-truthfulness,
.sf-truthfulness-labels,
.sf-truth-block,
.sf-truth-block-grid,
.settings-disclaimer,
#debug-panel,
#footer,
#admin-footer,
#cp-footer,
.aw-footer,
.aw-dev-archive,
.aw-legacy-archive,
.aw-safe-tags,
.demo-badge,
.mock-badge,
.mock-warning,
.cp-footer-labels,
.cp-section-subtitle strong,
.sf-bridge-note,
#campaigns-run-instructions,
#intel-note,
.fd-note code,
.feedback-intro code,
.intel-note code {
  display: none !important;
}

.cp-section-tab[data-section="roadmap"],
.cp-nav-badge {
  display: none !important;
}

.og-platform-shell,
.aw-top-bar,
.aw-section-nav,
#top-bar,
.cp-nav,
.admin-nav {
  background:
    linear-gradient(145deg, rgba(16, 23, 35, 0.92), rgba(9, 14, 23, 0.88)) !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: var(--premium-radius) !important;
  box-shadow: var(--premium-shadow);
  width: min(calc(100% - 28px), 1360px);
  margin: 14px auto 0;
}

.og-platform-brand strong,
.logo-text,
.aw-hero-title,
.sf-hero-title,
.ds-hero h1,
.cp-hero h1,
.admin-hero h1,
h1,
h2,
h3 {
  color: var(--premium-text) !important;
  letter-spacing: 0;
}

.og-platform-brand span,
.og-platform-status span,
.section-desc,
.aw-section-note,
.sf-section-desc,
.ds-section-head,
.cp-section-subtitle,
.admin-label,
p {
  color: var(--premium-muted);
}

.og-platform-brand > div span {
  font-size: 12px;
}

.og-platform-brand > div span::after {
  content: none;
}

.og-platform-nav a,
.og-platform-status span,
.aw-top-bar a,
.aw-top-bar button,
.aw-nav-link,
.top-tab,
.cp-nav a,
.admin-nav a {
  border: 1px solid rgba(244, 211, 143, 0.16) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--premium-muted) !important;
  border-radius: 999px !important;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px !important;
  font-weight: 700;
  text-decoration: none;
}

.og-platform-nav a.active,
.aw-top-bar a.active,
.aw-section-nav a.active,
.top-tab.active,
.cp-nav a.active,
.admin-nav a.active,
.btn-primary,
.cp-btn-primary,
.sf-btn-primary,
.ds-primary-cta,
.aw-primary-cta,
.aw-canvas-start-btn {
  background: linear-gradient(135deg, var(--premium-gold), var(--premium-gold-deep)) !important;
  color: #130e05 !important;
  border-color: rgba(244, 211, 143, 0.48) !important;
  box-shadow: 0 14px 34px rgba(183, 138, 62, 0.24);
}

.og-first-screen,
.aw-hero,
.sf-hero,
.ds-hero,
.cp-hero,
.admin-hero {
  background:
    linear-gradient(145deg, rgba(18, 26, 39, 0.92), rgba(7, 12, 21, 0.84)),
    radial-gradient(circle at 78% 12%, rgba(120, 170, 255, 0.16), transparent 34%),
    radial-gradient(circle at 12% 0%, rgba(241, 207, 131, 0.14), transparent 34%) !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: 24px !important;
  box-shadow: var(--premium-shadow);
  overflow: hidden;
}

.og-first-screen h1::after,
.aw-hero-title::after,
.sf-hero-title::after,
.ds-hero h1::after,
.cp-hero h1::after,
.admin-hero h1::after {
  content: "";
  display: block;
  width: 76px;
  height: 2px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--premium-gold), transparent);
}

.og-first-copy > span,
.ds-kicker,
.sf-kicker,
.cp-kicker,
.admin-label-warn,
.aw-safety-label,
.aw-premium-chip,
.sf-roadmap-badge,
.cp-roadmap-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(244, 211, 143, 0.22);
  color: var(--premium-gold) !important;
  background: rgba(244, 211, 143, 0.08) !important;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.og-first-copy > span {
  font-size: 0;
}

.og-first-copy > span::after {
  content: "Фабрика реальности";
  font-size: 11px;
}

.og-first-chips span,
.aw-premium-chip,
.aw-live-indicator,
.sf-value-card,
.fd-card,
.campaign-card,
.intel-card,
.stat-card,
.cp-tier-card,
.cp-module-card,
.ds-story-card,
.ds-persona-card,
.admin-section,
.cp-section,
.sf-section,
#sidebar,
#chat-panel,
#fd-panel,
#campaigns-panel,
#intel-panel,
#feedback-panel,
.aw-premium-card,
.aw-section-group,
.aw-live-chat-canvas,
.aw-central-chat-canvas,
.aw-one-page-client-report {
  background: var(--premium-panel) !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: var(--premium-radius) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055), 0 18px 58px rgba(0,0,0,0.28);
}

table,
#fd-table,
.data-table,
.cp-arch-box {
  background: rgba(7, 12, 21, 0.62) !important;
  border-color: var(--premium-line) !important;
}

th,
td {
  border-color: rgba(244, 211, 143, 0.1) !important;
}

button,
input,
select,
textarea,
.btn,
.btn-secondary,
.cp-btn-secondary,
.sf-btn-secondary,
.ds-secondary-cta {
  border-radius: 12px !important;
  border-color: rgba(244, 211, 143, 0.18) !important;
  font: inherit;
}

input,
select,
textarea,
.mock-setting-input {
  background: rgba(255,255,255,0.045) !important;
  color: var(--premium-text) !important;
}

.view,
#app,
#admin-app,
#cp-app {
  overflow-x: hidden;
}

#app {
  height: auto !important;
  min-height: 100vh;
  overflow-y: auto !important;
}

#messenger-layout {
  min-height: min(680px, calc(100vh - 260px));
  width: min(calc(100% - 28px), 1360px);
  margin: 16px auto;
  gap: 14px;
}

#sidebar {
  border-right: 0 !important;
}

#chat-header,
#composer,
#debug-summary,
.aw-collapsible-header {
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(244, 211, 143, 0.12) !important;
}

.safety-badge,
.badge,
#persistence-disclaimer,
#composer-diagnostic-label,
#user-switch-notice,
.aw-not-source-of-truth,
.aw-source-truth-badge,
.aw-synthetic-badge {
  color: var(--premium-gold) !important;
  background: rgba(244, 211, 143, 0.08) !important;
  border-color: rgba(244, 211, 143, 0.18) !important;
}

#persistence-disclaimer,
#composer-diagnostic-label {
  font-size: 0;
}

#persistence-disclaimer::after {
  content: "Рабочее пространство остаётся в рамках текущей сессии.";
  font-size: 12px;
}

#composer-diagnostic-label::after {
  content: "Составьте сообщение для выбранной аудитории.";
  font-size: 12px;
}

.aw-section-group.aw-safety-archive,
#controlled-call-content,
#section-aitunnel,
#section-roadmap,
#cp-section-roadmap {
  display: none !important;
}

.aw-section-nav a[href="#section-safety"],
.aw-section-nav a[href="#section-aitunnel"],
.aw-top-bar a[href="/admin"],
.aw-top-bar a[href="/company-pack"] {
  display: none !important;
}

.aw-top-bar a,
#top-bar .top-tab {
  font-size: 0 !important;
}

.aw-top-bar a[href="/"]::after,
#tab-main::after { content: "Мессенджер"; font-size: 12px; }
.aw-top-bar a[href="/scenario-frequency"]::after,
#tab-scenarios::after,
#tab-scenario-frequency::after { content: "Сценарии"; font-size: 12px; }
.aw-top-bar a[href="/agent-world"]::after,
#tab-agent-world::after { content: "Советник"; font-size: 12px; }
#tab-feedback::after { content: "Отклики"; font-size: 12px; }
#tab-feedback-dashboard::after { content: "Пульс"; font-size: 12px; }
#tab-campaigns::after { content: "Кампании"; font-size: 12px; }
#tab-intelligence::after { content: "Инсайты"; font-size: 12px; }
#tab-admin::after { content: "Управление"; font-size: 12px; }
#tab-company-pack::after { content: "Пакет"; font-size: 12px; }

.loading-row,
.fd-loading,
.campaigns-loading,
.intel-loading {
  color: var(--premium-muted) !important;
}

@media (max-width: 820px) {
  .og-platform-shell,
  .aw-top-bar,
  .aw-section-nav,
  #top-bar,
  #messenger-layout {
    width: calc(100% - 16px);
  }

  #messenger-layout {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    min-width: 0;
  }
}

/* Probe404 v5.2 Patch C - Reality Factory product layer */
body.p404-canonical-localized > :not(.p404-factory-shell):not(script):not(style):not(link) {
  display: none !important;
}

.p404-factory-shell {
  width: min(calc(100% - 28px), 1360px);
  margin: 16px auto 18px;
  color: var(--premium-text);
}

.p404-canonical-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  margin-bottom: 16px;
  border: 1px solid rgba(244, 211, 143, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(18, 26, 39, 0.92), rgba(7, 12, 21, 0.86)),
    radial-gradient(circle at 8% 0%, rgba(241, 207, 131, 0.12), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(120, 170, 255, 0.1), transparent 30%);
  box-shadow: var(--premium-shadow);
  padding: 12px 14px;
}

.p404-brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--premium-text);
  text-decoration: none;
  min-width: 230px;
}

.p404-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(244, 211, 143, 0.34);
  border-radius: 14px;
  background: rgba(244, 211, 143, 0.08);
  color: var(--premium-gold);
  font-weight: 950;
  letter-spacing: 0;
}

.p404-brand strong,
.p404-brand em {
  display: block;
  font-style: normal;
  letter-spacing: 0;
}

.p404-brand strong {
  color: var(--premium-text);
  font-size: 18px;
  line-height: 1;
}

.p404-brand em {
  margin-top: 4px;
  color: var(--premium-muted);
  font-size: 12px;
}

.p404-canonical-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.p404-canonical-nav nav a,
.p404-lang-switch a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 211, 143, 0.17);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--premium-muted);
  padding: 0 13px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.p404-canonical-nav nav a[aria-current="page"],
.p404-lang-switch a.is-active {
  background: linear-gradient(135deg, var(--premium-gold), var(--premium-gold-deep));
  border-color: rgba(244, 211, 143, 0.44);
  color: #150f06;
}

.p404-lang-switch {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.p404-hero,
.p404-stack-section,
.p404-report-grid > article {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(244, 211, 143, 0.2);
  background:
    linear-gradient(145deg, rgba(18, 26, 39, 0.94), rgba(7, 12, 21, 0.86)),
    radial-gradient(circle at 82% 12%, rgba(120, 170, 255, 0.13), transparent 32%),
    radial-gradient(circle at 8% 0%, rgba(241, 207, 131, 0.13), transparent 34%);
  box-shadow: var(--premium-shadow);
}

.p404-report-cockpit {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(90, 135, 205, 0.34);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 8%, rgba(241, 207, 131, 0.10), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(69, 132, 255, 0.15), transparent 30%),
    linear-gradient(145deg, rgba(7, 14, 25, 0.98), rgba(4, 9, 16, 0.98));
  box-shadow: 0 28px 92px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.055);
  padding: 14px;
}

.p404-report-cockpit::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(241, 207, 131, 0.24) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.28;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.8), transparent 72%);
}

.p404-cockpit-top,
.p404-cockpit-middle,
.p404-cockpit-bottom {
  position: relative;
  z-index: 1;
}

.p404-cockpit-top {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) 260px 270px 320px;
  gap: 12px;
  align-items: stretch;
}

.p404-cockpit-title,
.p404-kpi,
.p404-exec-card,
.p404-cockpit-ring,
.p404-loss-card,
.p404-fix-card,
.p404-agent-card {
  border: 1px solid rgba(90, 135, 205, 0.28);
  border-radius: 16px;
  background: rgba(8, 18, 32, 0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.p404-cockpit-title {
  padding: 16px 18px;
}

.p404-cockpit-title h1 {
  max-width: 620px;
  margin: 0;
  color: var(--premium-text) !important;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 0.98;
}

.p404-cockpit-title p {
  max-width: 720px;
  margin: 10px 0 0;
  color: #b9c5d6 !important;
  font-size: 14px;
  line-height: 1.55;
}

.p404-audit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.p404-audit-chips span {
  display: inline-flex;
  min-height: 28px;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(244, 211, 143, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #e6d3a3;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.p404-kpi {
  min-height: 142px;
  padding: 16px;
}

.p404-kpi > span,
.p404-exec-card h2,
.p404-loss-card h2,
.p404-fix-card h2,
.p404-agent-card h2,
.p404-cockpit-ring h3 {
  margin: 0;
  color: var(--premium-text) !important;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 900;
}

.p404-kpi > span {
  display: block;
  max-width: 150px;
}

.p404-kpi > strong {
  display: block;
  margin-top: 20px;
  color: #ffd56c;
  font-size: 34px;
  line-height: 1;
}

.p404-kpi > small {
  display: block;
  margin-top: 6px;
  color: var(--premium-muted);
  font-weight: 700;
}

.p404-kpi-ring {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: center;
}

.p404-main-ring,
.p404-mini-ring {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #07111f 0 56%, transparent 57%),
    conic-gradient(#4f8cff var(--value), rgba(255,255,255,0.08) 0);
  box-shadow: inset 0 0 0 8px rgba(30, 43, 62, 0.84), 0 0 34px rgba(78, 140, 255, 0.14);
}

.p404-main-ring {
  width: 112px;
}

.p404-main-ring strong,
.p404-mini-ring strong {
  grid-area: 1 / 1;
  color: #ffe19c;
  font-size: 38px;
  line-height: 1;
}

.p404-main-ring small,
.p404-mini-ring span {
  grid-area: 1 / 1;
  align-self: end;
  margin-bottom: 25px;
  color: var(--premium-muted);
  font-size: 11px;
}

.p404-impact dl {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.p404-impact div {
  display: grid;
  grid-template-columns: 80px minmax(70px, 1fr) 78px;
  gap: 10px;
  align-items: center;
}

.p404-impact dt {
  color: #d8deea;
  font-size: 12px;
}

.p404-impact dd {
  height: 6px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f8cff 0 54%, #f1cf83 54% 78%, rgba(255,255,255,0.1) 78%);
}

.p404-impact b {
  color: #ffd56c;
  font-size: 12px;
  text-align: right;
}

.p404-cockpit-middle {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.p404-exec-card,
.p404-loss-card,
.p404-fix-card,
.p404-agent-card {
  padding: 16px;
}

.p404-exec-card p {
  margin: 12px 0 14px;
  color: #dce7f5 !important;
  font-size: 13px;
  line-height: 1.55;
}

.p404-exec-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.p404-exec-card dl div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 8px;
}

.p404-exec-card dt {
  color: #b7c1d1;
}

.p404-exec-card dd {
  margin: 0;
  color: #ffffff;
  font-weight: 900;
}

.p404-ring-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(90, 135, 205, 0.28);
  border-radius: 16px;
  background: rgba(8, 18, 32, 0.58);
  overflow: hidden;
}

.p404-cockpit-ring {
  display: grid;
  min-height: 236px;
  justify-items: center;
  align-content: start;
  gap: 10px;
  border-width: 0 1px 0 0;
  border-radius: 0;
  background: transparent;
  padding: 16px 14px;
  text-align: center;
}

.p404-cockpit-ring:last-child {
  border-right: 0;
}

.p404-mini-ring {
  width: 92px;
}

.p404-mini-ring strong {
  font-size: 30px;
}

.p404-mini-ring span {
  margin-bottom: 20px;
}

.p404-ring-red .p404-mini-ring { background: radial-gradient(circle at center, #07111f 0 56%, transparent 57%), conic-gradient(#ff534a var(--value), rgba(255,255,255,0.08) 0); }
.p404-ring-orange .p404-mini-ring { background: radial-gradient(circle at center, #07111f 0 56%, transparent 57%), conic-gradient(#f28b36 var(--value), rgba(255,255,255,0.08) 0); }
.p404-ring-gold .p404-mini-ring { background: radial-gradient(circle at center, #07111f 0 56%, transparent 57%), conic-gradient(#f0c95f var(--value), rgba(255,255,255,0.08) 0); }
.p404-ring-blue .p404-mini-ring { background: radial-gradient(circle at center, #07111f 0 56%, transparent 57%), conic-gradient(#4e9cff var(--value), rgba(255,255,255,0.08) 0); }
.p404-ring-violet .p404-mini-ring { background: radial-gradient(circle at center, #07111f 0 56%, transparent 57%), conic-gradient(#8b5cf6 var(--value), rgba(255,255,255,0.08) 0); }

.p404-cockpit-ring p {
  min-height: 40px;
  margin: 0;
  color: #aebbd0 !important;
  font-size: 12px;
  line-height: 1.35;
}

.p404-cockpit-ring a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(244, 211, 143, 0.38);
  border-radius: 999px;
  color: #ffe19c;
  padding: 0 14px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.p404-cockpit-bottom {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.1fr;
  gap: 10px;
  margin-top: 10px;
}

.p404-loss-card {
  border-color: rgba(255, 83, 74, 0.38);
}

.p404-fix-card {
  border-color: rgba(90, 135, 205, 0.38);
}

.p404-agent-card {
  border-color: rgba(244, 211, 143, 0.26);
}

.p404-loss-card ul,
.p404-fix-card ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.p404-loss-card li,
.p404-fix-card li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 8px;
  color: #f3f7ff;
  font-size: 13px;
}

.p404-fix-card li {
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.p404-fix-card i {
  color: #33ffb1;
  font-style: normal;
}

.p404-loss-card b,
.p404-fix-card b {
  border: 1px solid rgba(244, 211, 143, 0.2);
  border-radius: 8px;
  background: rgba(244, 211, 143, 0.08);
  color: #ffd56c;
  padding: 4px 8px;
  font-size: 11px;
}

.p404-agent-card {
  display: grid;
  gap: 9px;
}

.p404-agent-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  padding: 10px;
}

.p404-agent-row i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5f7cff, #8b5cf6);
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.p404-agent-row strong,
.p404-agent-row small {
  display: block;
}

.p404-agent-row strong {
  color: #7fb2ff;
  font-size: 13px;
}

.p404-agent-row small {
  margin-top: 3px;
  color: #d5deec;
  font-size: 12px;
  line-height: 1.35;
}

.p404-search-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 16px 0;
  border: 1px solid rgba(244, 211, 143, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.p404-search-band input {
  min-height: 48px;
  border: 1px solid rgba(244, 211, 143, 0.16) !important;
  border-radius: 14px !important;
  background: rgba(6, 10, 18, 0.72) !important;
  color: var(--premium-text) !important;
  padding: 0 16px;
  outline: none;
}

.p404-search-band span {
  color: var(--premium-muted);
  font-size: 13px;
  line-height: 1.4;
}

.p404-boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.p404-boundary-grid article {
  min-height: 190px;
  border: 1px solid rgba(244, 211, 143, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(18, 26, 39, 0.9), rgba(7, 12, 21, 0.82)),
    radial-gradient(circle at 92% 12%, rgba(120, 170, 255, 0.11), transparent 30%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055), 0 18px 58px rgba(0,0,0,0.22);
  padding: 22px;
}

.p404-boundary-grid span {
  color: var(--premium-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.p404-boundary-grid h2 {
  margin: 18px 0 10px;
  color: var(--premium-text) !important;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.p404-boundary-grid p {
  margin: 0;
  color: var(--premium-muted) !important;
  font-size: 15px;
  line-height: 1.7;
}

.p404-orchestrator-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(244, 211, 143, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(18, 26, 39, 0.92), rgba(7, 12, 21, 0.84)),
    radial-gradient(circle at 88% 10%, rgba(120, 170, 255, 0.12), transparent 32%),
    radial-gradient(circle at 8% 0%, rgba(241, 207, 131, 0.12), transparent 30%);
  box-shadow: var(--premium-shadow);
  padding: clamp(20px, 3vw, 34px);
}

.p404-orchestrator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.p404-orchestrator-actions button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 211, 143, 0.4) !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--premium-gold), var(--premium-gold-deep)) !important;
  color: #150f06 !important;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.p404-orchestrator-actions button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.p404-orchestrator-actions strong {
  color: var(--premium-gold);
  font-size: 13px;
}

.p404-orchestrator-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.p404-orchestrator-summary article {
  min-height: 92px;
  border: 1px solid rgba(244, 211, 143, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.p404-orchestrator-summary span,
.p404-system-card > span {
  display: block;
  color: var(--premium-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.p404-orchestrator-summary strong {
  display: block;
  margin-top: 10px;
  color: var(--premium-text);
  font-size: 34px;
  line-height: 1;
}

.p404-orchestrator-summary p {
  margin: 10px 0 0;
  color: var(--premium-muted) !important;
  font-size: 14px;
  line-height: 1.6;
}

.p404-summary-wide {
  grid-column: 1 / -1;
}

.p404-system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.p404-system-card {
  min-height: 250px;
  border: 1px solid rgba(244, 211, 143, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  padding: 18px;
}

.p404-system-card h3 {
  margin: 18px 0 10px;
  color: var(--premium-text) !important;
  font-size: 24px;
  line-height: 1.05;
}

.p404-system-card p {
  margin: 0;
  color: var(--premium-muted) !important;
  font-size: 14px;
  line-height: 1.65;
}

.p404-component-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.p404-component-row small {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(244, 211, 143, 0.14);
  border-radius: 14px;
  background: rgba(6, 10, 18, 0.4);
  color: var(--premium-text);
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.25;
}

.p404-component-row b {
  color: var(--premium-gold);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.p404-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  min-height: 340px;
  border-radius: 28px;
  padding: clamp(22px, 4vw, 44px);
}

.p404-kicker,
.p404-section-head > span,
.p404-report-grid span,
.p404-proof-panel > span {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(244, 211, 143, 0.24);
  border-radius: 999px;
  background: rgba(244, 211, 143, 0.08);
  color: var(--premium-gold);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.p404-hero h1,
.p404-section-head h2,
.p404-report-grid h2 {
  max-width: 840px;
  margin: 16px 0 0;
  color: var(--premium-text) !important;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.94;
  letter-spacing: 0;
}

.p404-section-head h2,
.p404-report-grid h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.p404-hero p,
.p404-section-head p,
.p404-report-grid p,
.p404-module-card p {
  max-width: 760px;
  color: var(--premium-muted) !important;
  font-size: 15px;
  line-height: 1.75;
}

.p404-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.p404-action-row a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 211, 143, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--premium-text);
  padding: 0 16px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.p404-action-row a:first-child {
  background: linear-gradient(135deg, var(--premium-gold), var(--premium-gold-deep));
  color: #140e05;
}

.p404-proof-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  border: 1px solid rgba(120, 170, 255, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(120, 170, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(6, 10, 18, 0.54);
  padding: 22px;
}

.p404-proof-panel strong {
  max-width: 280px;
  font-size: 30px;
  line-height: 1.05;
}

.p404-proof-panel dl {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
}

.p404-proof-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(244, 211, 143, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.p404-proof-panel dt {
  color: var(--premium-muted);
}

.p404-proof-panel dd {
  margin: 0;
  color: var(--premium-gold);
  font-weight: 900;
}

.p404-stack-section {
  margin-top: 16px;
  border-radius: 28px;
  padding: clamp(20px, 3vw, 34px);
}

.p404-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.p404-module-card {
  min-height: 190px;
  border: 1px solid rgba(244, 211, 143, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  padding: 18px;
  transform: translateY(8px);
  opacity: 0;
  animation: p404-card-in 620ms ease forwards;
  animation-delay: var(--p404-delay);
}

.p404-module-index {
  color: var(--premium-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.p404-module-card h3 {
  margin: 18px 0 8px;
  color: var(--premium-text) !important;
  font-size: 18px;
  line-height: 1.1;
}

.p404-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.p404-report-grid > article {
  min-height: 250px;
  border-radius: 26px;
  padding: clamp(20px, 3vw, 32px);
}

@keyframes p404-card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .p404-module-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1100px) {
  .p404-cockpit-top,
  .p404-cockpit-middle,
  .p404-cockpit-bottom {
    grid-template-columns: 1fr;
  }

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

  .p404-cockpit-ring {
    border-width: 0 0 1px 0;
  }

  .p404-cockpit-ring:nth-child(odd) {
    border-right: 1px solid rgba(90, 135, 205, 0.28);
  }

  .p404-cockpit-ring:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .p404-hero,
  .p404-report-grid,
  .p404-boundary-grid,
  .p404-orchestrator-summary,
  .p404-system-grid,
  .p404-canonical-nav {
    grid-template-columns: 1fr;
  }

  .p404-canonical-nav nav,
  .p404-lang-switch {
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .p404-factory-shell {
    width: calc(100% - 16px);
  }

  .p404-report-cockpit {
    border-radius: 18px;
    padding: 8px;
  }

  .p404-cockpit-title,
  .p404-kpi,
  .p404-exec-card,
  .p404-loss-card,
  .p404-fix-card,
  .p404-agent-card {
    border-radius: 14px;
    padding: 14px;
  }

  .p404-cockpit-title h1 {
    font-size: 34px;
  }

  .p404-kpi-ring {
    grid-template-columns: 1fr;
  }

  .p404-main-ring {
    width: 104px;
  }

  .p404-ring-strip {
    grid-template-columns: 1fr;
  }

  .p404-cockpit-ring,
  .p404-cockpit-ring:nth-child(odd) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(90, 135, 205, 0.28);
  }

  .p404-cockpit-ring:last-child {
    border-bottom: 0;
  }

  .p404-loss-card li {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .p404-fix-card li {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .p404-fix-card b {
    grid-column: 2;
    width: fit-content;
  }

  .p404-hero,
  .p404-stack-section,
  .p404-report-grid > article,
  .p404-boundary-grid article,
  .p404-orchestrator-panel,
  .p404-canonical-nav {
    border-radius: 20px;
    padding: 18px;
  }

  .p404-hero h1 {
    font-size: 40px;
  }

  .p404-module-grid {
    grid-template-columns: 1fr;
  }

  .p404-proof-panel {
    min-height: 0;
  }

  .p404-action-row a {
    width: 100%;
  }

  .p404-search-band {
    grid-template-columns: 1fr;
  }

  .p404-brand {
    min-width: 0;
  }
}
