:root {
  --psych-space-1: 8px;
  --psych-space-2: 12px;
  --psych-space-3: 16px;
  --psych-space-4: 22px;
  --psych-space-5: 30px;
  --psych-radius-sm: 10px;
  --psych-radius-md: 14px;
  --psych-radius-lg: 18px;
  --psych-shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.28);
  --psych-shadow-glow: 0 0 36px rgba(212, 175, 55, 0.18);
  --psych-line: rgba(255, 255, 255, 0.11);
  --psych-line-soft: rgba(255, 255, 255, 0.07);
  --psych-text: #edf1f7;
  --psych-muted: #b8c2d0;
  --psych-muted-soft: #97a4b7;
  --psych-gold: #d4af37;
  --psych-bg: #0f1116;
}

html,
body {
  overflow-x: hidden;
}

.psych-header-shell {
  --psych-header-gold: #ffb800;
  --psych-header-gold-glow: rgba(255, 184, 0, 0.4);
  --psych-header-dark: #05070a;
  --psych-header-text: #ffffff;
  --psych-header-text-dim: #94a3b8;
  --psych-header-stroke: #1e293b;
  color: var(--psych-header-text);
  background: var(--psych-header-dark);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  position: relative;
}

.psych-header-shell * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.psych-header-shell a {
  color: inherit;
}

.psych-header-container {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 0;
  display: block;
  max-width: none;
  gap: 0;
}

.psych-skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 3000;
}

.psych-skip-link:focus {
  left: 12px;
}

.psych-navbar {
  padding: 1.2rem 0;
  position: relative;
  width: 100%;
  z-index: 20;
  background: rgba(5, 7, 10, 0.9);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.psych-nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.psych-logo {
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -1px;
}

.psych-logo span {
  color: var(--psych-header-gold);
}

.psych-nav-links {
  display: flex;
  gap: 1.5rem;
  font-weight: 600;
}

.psych-nav-links a {
  text-decoration: none;
  color: var(--psych-header-text-dim);
  transition: color 0.2s ease;
}

.psych-nav-links a:hover {
  color: var(--psych-header-text);
}

.psych-btn-nav {
  background: transparent;
  border: 1px solid var(--psych-header-stroke);
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
}

.psych-btn-nav:hover {
  border-color: var(--psych-header-gold);
  color: var(--psych-header-gold);
}

.psych-nav-toggle {
  border: 1px solid var(--psych-header-stroke);
  background: transparent;
  color: var(--psych-header-text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.1rem;
}

.psych-mobile-only {
  display: none;
}

.psych-mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  left: 16px;
  padding: 16px;
  background: rgba(8, 12, 18, 0.96);
  border: 1px solid var(--psych-header-stroke);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  transform: translateY(-20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 30;
}

.psych-mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.psych-mobile-menu a {
  text-decoration: none;
  color: var(--psych-header-text);
  font-weight: 600;
}

body {
  background:
    radial-gradient(1000px 420px at 50% -18%, rgba(212, 175, 55, 0.14), transparent 62%),
    radial-gradient(700px 320px at 100% 120%, rgba(212, 175, 55, 0.08), transparent 55%),
    linear-gradient(180deg, #11141b 0%, #0d1016 56%, #0a0c11 100%);
  color: var(--psych-text);
}

.psych-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 10px 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.psych-page a:focus-visible,
.psych-page button:focus-visible {
  outline: 2px solid rgba(255, 215, 0, 0.9);
  outline-offset: 2px;
}

.psych-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--psych-line);
  border-radius: var(--psych-radius-lg);
  padding: 18px;
  background: linear-gradient(135deg, rgba(25, 29, 38, 0.95), rgba(16, 19, 26, 0.96));
  box-shadow: var(--psych-shadow-soft), var(--psych-shadow-glow);
  overflow: hidden;
}

.psych-header::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -140px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.24), transparent 68%);
  pointer-events: none;
}

.psych-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c9b16b;
  font-weight: 700;
}

.psych-header h1 {
  margin: 0;
  font-size: clamp(26px, 4.4vw, 34px);
  color: #f6f8fb;
  line-height: 1.1;
}

.psych-subtitle {
  margin: 8px 0 0;
  color: var(--psych-muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 64ch;
}

.psych-back {
  width: 100%;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

#mindStateCard,
#riskManager,
#psychCharts,
#detectorsGrid {
  scroll-margin-top: 110px;
}

.psych-footer-cta {
  display: flex;
  justify-content: center;
}

.psych-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  color: #131518;
  background: linear-gradient(135deg, var(--psych-gold), #e7c65a);
  box-shadow: 0 12px 24px rgba(212, 175, 55, 0.22);
}

.psych-footer-btn:hover {
  filter: brightness(1.05);
}

.psych-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.psych-guest,
.psych-empty,
.mindstate-card,
.risk-manager-card,
.guide-card,
.summary-card,
.action-plan-card,
.psych-chart-card,
.detector-card {
  border-radius: var(--psych-radius-md);
  border: 1px solid var(--psych-line);
  background: linear-gradient(145deg, rgba(22, 26, 34, 0.95), rgba(15, 18, 25, 0.94));
  box-shadow: var(--psych-shadow-soft);
}

.psych-guest,
.psych-empty {
  padding: 16px;
}

.psych-guest-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c9b16b;
  font-weight: 700;
}

.psych-guest h2,
.psych-empty h2 {
  margin: 0 0 10px;
  color: #f4f7fc;
}

.psych-guest-lead,
.psych-empty p {
  margin: 0 0 14px;
  color: var(--psych-muted);
  line-height: 1.55;
}

.psych-guest-list {
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--psych-muted);
  display: grid;
  gap: 8px;
}

.psych-guest-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mindstate-card,
.risk-manager-card,
.guide-card,
.summary-card,
.action-plan-card,
.psych-chart-card {
  padding: 14px;
}

.preview-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: rgba(212, 175, 55, 0.12);
  color: #f5de97;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.operational-banner {
  border-radius: var(--psych-radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--psych-line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.operational-banner__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--psych-muted-soft);
}

.operational-banner__value {
  font-size: 14px;
}

.operational-banner.perm-green {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.3);
}

.operational-banner.perm-yellow,
.operational-banner.perm-orange {
  background: rgba(246, 198, 81, 0.13);
  border-color: rgba(246, 198, 81, 0.35);
}

.operational-banner.perm-red {
  background: rgba(231, 76, 60, 0.14);
  border-color: rgba(231, 76, 60, 0.35);
}

.mindstate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mindstate-title {
  margin: 0;
  font-size: 20px;
}

.mindstate-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid #3a4351;
  background: #151b24;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 12px;
}

.mindstate-badge.green { border-color: rgba(46, 204, 113, 0.5); color: #a9f0c7; }
.mindstate-badge.yellow { border-color: rgba(246, 198, 81, 0.55); color: #f7df9c; }
.mindstate-badge.orange { border-color: rgba(240, 146, 71, 0.55); color: #ffc79a; }
.mindstate-badge.red { border-color: rgba(231, 76, 60, 0.55); color: #ffb0a9; }

.mindstate-subtitle {
  margin: 10px 0 0;
  color: var(--psych-muted);
  font-size: 13px;
}

.mindstate-trigger {
  margin: 8px 0 0;
  color: #c8d1df;
  font-size: 13px;
}

.mindstate-rule {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #f2f6fb;
  border-left: 3px solid rgba(212, 175, 55, 0.75);
  padding: 8px 0 8px 10px;
  background: rgba(212, 175, 55, 0.08);
  border-radius: 0 var(--psych-radius-sm) var(--psych-radius-sm) 0;
}

.mindstate-rule span {
  color: #f8d981;
  font-weight: 700;
}

.mindstate-links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.mindstate-links a {
  color: #f6d77f;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
  font-weight: 600;
}

.risk-manager-head,
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.risk-manager h2,
.psych-summary h2,
.action-plan h2 {
  margin: 0;
  font-size: 18px;
}

.risk-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--psych-line);
  font-size: 12px;
  font-weight: 700;
}

.risk-status--green { color: #9ceac0; border-color: rgba(46, 204, 113, 0.45); }
.risk-status--yellow,
.risk-status--orange { color: #f7de99; border-color: rgba(246, 198, 81, 0.45); }
.risk-status--red { color: #ffafa7; border-color: rgba(231, 76, 60, 0.45); }

.risk-tiles,
.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.guide-tile {
  border: 1px solid var(--psych-line-soft);
  border-radius: var(--psych-radius-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.guide-tile strong {
  display: block;
  color: #f2f6fb;
  margin-bottom: 6px;
}

.guide-tile p {
  margin: 0;
  color: var(--psych-muted);
  font-size: 13px;
  line-height: 1.5;
}

.risk-tile,
.summary-tile {
  border: 1px solid var(--psych-line-soft);
  border-radius: var(--psych-radius-sm);
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.risk-tile span,
.summary-tile span {
  display: block;
  color: var(--psych-muted-soft);
  font-size: 12px;
}

.risk-tile strong,
.summary-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  color: #f2f6fb;
}

.risk-why {
  margin: 12px 0 0;
  color: var(--psych-muted);
  font-size: 13px;
  line-height: 1.5;
}

.summary-trend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-pill {
  border-radius: 999px;
  border: 1px solid var(--psych-line);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
}

.trend-pill.up { color: #ffb6b0; border-color: rgba(231, 76, 60, 0.5); }
.trend-pill.down { color: #9ceac0; border-color: rgba(46, 204, 113, 0.5); }
.trend-pill.up-good { color: #9ceac0; border-color: rgba(46, 204, 113, 0.5); }
.trend-pill.down-bad { color: #ffb6b0; border-color: rgba(231, 76, 60, 0.5); }

.summary-timeline {
  margin-top: 12px;
}

.timeline-label {
  display: block;
  margin-bottom: 7px;
  color: var(--psych-muted-soft);
  font-size: 12px;
}

.timeline-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-dot {
  width: 16px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.timeline-dot.is-win { background: rgba(46, 204, 113, 0.9); border-color: rgba(46, 204, 113, 0.95); }
.timeline-dot.is-loss { background: rgba(231, 76, 60, 0.9); border-color: rgba(231, 76, 60, 0.95); }
.timeline-dot.is-unknown { background: rgba(148, 163, 184, 0.72); border-color: rgba(148, 163, 184, 0.82); }

.action-plan-card {
  border-left: 4px solid rgba(212, 175, 55, 0.75);
}

.action-plan-card.is-red { border-left-color: rgba(231, 76, 60, 0.92); }
.action-plan-card.is-orange { border-left-color: rgba(240, 146, 71, 0.92); }
.action-plan-card.is-yellow { border-left-color: rgba(246, 198, 81, 0.92); }
.action-plan-card.is-green { border-left-color: rgba(46, 204, 113, 0.92); }

.action-priority,
.action-immediate,
.action-rule {
  margin: 10px 0 0;
  color: #dbe2ee;
  font-size: 13px;
  line-height: 1.5;
}

.action-priority {
  font-weight: 700;
  color: #f2f6fb;
}

.detector-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.psych-charts,
.psych-section-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.psych-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
}

.psych-chart-card--wide {
  grid-column: 1 / -1;
}

.psych-chart-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.psych-chart-card__head h3 {
  margin: 0;
  font-size: 17px;
}

.psych-chart-card__head p {
  margin: 6px 0 0;
  color: var(--psych-muted);
  font-size: 13px;
  line-height: 1.5;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 12px;
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #dfe6f1;
  font-size: 11px;
  font-weight: 600;
}

.chart-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.chart-legend__dot--good { background: #41cc83; box-shadow: 0 0 10px rgba(65, 204, 131, 0.45); }
.chart-legend__dot--bad { background: #ff6b5f; box-shadow: 0 0 10px rgba(255, 107, 95, 0.45); }
.chart-legend__dot--warning { background: #ffc857; box-shadow: 0 0 10px rgba(255, 200, 87, 0.45); }
.chart-legend__dot--neutral { background: #9fb0c7; box-shadow: 0 0 10px rgba(159, 176, 199, 0.35); }

.psych-chart-card__note {
  margin: 12px 0 0;
  color: var(--psych-muted);
  font-size: 12px;
  line-height: 1.5;
}

.mini-chart-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 14px;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.45) rgba(255, 255, 255, 0.05);
}

.mini-chart-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.mini-chart-scroll {
  position: absolute;
  top: 14px;
  bottom: 8px;
  z-index: 4;
  width: 34px;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(90deg, rgba(8, 11, 16, 0.88), rgba(8, 11, 16, 0));
  opacity: 0.55;
  transition: opacity 160ms ease;
}

.mini-chart-scroll span {
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.mini-chart-scroll:active {
  opacity: 0.95;
}

.mini-chart-scroll.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.mini-chart-scroll--left {
  left: 0;
  border-radius: 12px 0 0 12px;
}

.mini-chart-scroll--right {
  right: 0;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(270deg, rgba(8, 11, 16, 0.88), rgba(8, 11, 16, 0));
}

.mini-chart {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(46px, 52px);
  gap: 8px;
  width: max(100%, calc(var(--chart-columns, 12) * 56px));
  min-width: 0;
  margin-top: 0;
  padding-top: 18px;
  min-height: 210px;
  align-items: end;
}

.mini-chart-threshold {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(212, 175, 55, 0.55);
  z-index: 1;
}

.mini-chart-threshold span {
  position: absolute;
  right: 0;
  transform: translateY(-120%);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(13, 16, 22, 0.92);
  color: #f5de97;
  font-size: 10px;
  white-space: nowrap;
}

.mini-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  scroll-snap-align: start;
  z-index: 2;
}

.mini-chart-value {
  color: #f2f6fb;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-chart-value--good { color: #73ebb2; }
.mini-chart-value--bad { color: #ff9b93; }
.mini-chart-value--warning { color: #ffd67f; }
.mini-chart-value--neutral { color: #d7e0ed; }
.mini-chart-value--empty { color: #95a4b7; }

.mini-chart-track {
  width: 100%;
  min-height: 130px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 6px 0;
}

.mini-chart-track--good {
  border-color: rgba(65, 204, 131, 0.25);
  background: linear-gradient(180deg, rgba(65, 204, 131, 0.08), rgba(65, 204, 131, 0.03));
}

.mini-chart-track--bad {
  border-color: rgba(255, 107, 95, 0.25);
  background: linear-gradient(180deg, rgba(255, 107, 95, 0.08), rgba(255, 107, 95, 0.03));
}

.mini-chart-track--warning {
  border-color: rgba(255, 200, 87, 0.25);
  background: linear-gradient(180deg, rgba(255, 200, 87, 0.08), rgba(255, 200, 87, 0.03));
}

.mini-chart-track--neutral {
  border-color: rgba(159, 176, 199, 0.2);
  background: linear-gradient(180deg, rgba(159, 176, 199, 0.07), rgba(159, 176, 199, 0.03));
}

.mini-chart-bar {
  width: min(24px, 84%);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transition: height 180ms ease;
}

.mini-chart-bar--good {
  background: linear-gradient(180deg, #6ff0b7, #22a866);
}

.mini-chart-bar--bad {
  background: linear-gradient(180deg, #ff9b93, #e04d3f);
}

.mini-chart-bar--warning {
  background: linear-gradient(180deg, #ffe08d, #e0a92e);
}

.mini-chart-bar--neutral {
  background: linear-gradient(180deg, #d8e0eb, #8d9caf);
}

.mini-chart-bar--empty {
  background: linear-gradient(180deg, #3a4351, #2a3240);
  opacity: 0.6;
}

.mini-chart-label {
  color: var(--psych-muted-soft);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.signal-meter-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.signal-meter {
  border: 1px solid var(--psych-line-soft);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.signal-meter__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #eef2f8;
  font-size: 12px;
  font-weight: 700;
}

.signal-meter__bar {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.signal-meter__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.signal-meter__fill--green { background: linear-gradient(90deg, #41cc83, #238f59); }
.signal-meter__fill--yellow { background: linear-gradient(90deg, #ffd46b, #d7a130); }
.signal-meter__fill--orange { background: linear-gradient(90deg, #ffba76, #dc7d2f); }
.signal-meter__fill--red { background: linear-gradient(90deg, #ff948c, #d4473b); }

.signal-meter__note {
  margin: 8px 0 0;
  color: var(--psych-muted);
  font-size: 12px;
  line-height: 1.45;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 18px;
}

.section-info-icon,
.tooltip-btn {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #3a4556;
  color: #c6d0dd;
  background: #1a1f2a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.detectors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.detector-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.detector-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.45);
}

.detector-card--priority {
  border-color: rgba(212, 175, 55, 0.62);
  box-shadow: var(--psych-shadow-soft), var(--psych-shadow-glow);
}

.detector-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.detector-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detector-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a1608;
  background: linear-gradient(135deg, #f4ce67, #e3b744);
  border: 1px solid rgba(212, 175, 55, 0.85);
}

.detector-name {
  margin: 0;
  font-size: 15px;
  color: #e7ebf2;
}

.detector-summary {
  margin: 0;
  color: var(--psych-muted);
  font-size: 13px;
  line-height: 1.5;
}

.detector-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #3a4350;
  font-size: 12px;
  font-weight: 700;
}

.detector-pill.green { color: #9ceac0; border-color: rgba(46, 204, 113, 0.45); }
.detector-pill.yellow { color: #f7de99; border-color: rgba(246, 198, 81, 0.45); }
.detector-pill.orange { color: #ffc594; border-color: rgba(240, 146, 71, 0.45); }
.detector-pill.red { color: #ffafa7; border-color: rgba(231, 76, 60, 0.45); }

.detector-confidence {
  color: var(--psych-muted-soft);
  font-size: 12px;
}

.detector-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric-pill {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--psych-line-soft);
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}

.metric-pill strong {
  color: #f2f6fb;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.metric-pill span {
  color: var(--psych-muted-soft);
  font-size: 11px;
  line-height: 1.35;
}

.metric-pill--good {
  border-color: rgba(46, 204, 113, 0.28);
  background: rgba(46, 204, 113, 0.08);
}

.metric-pill--warning {
  border-color: rgba(246, 198, 81, 0.28);
  background: rgba(246, 198, 81, 0.08);
}

.metric-pill--bad {
  border-color: rgba(231, 76, 60, 0.28);
  background: rgba(231, 76, 60, 0.08);
}

.detector-line {
  margin: 0;
  color: #d7dde6;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid #2a333e;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detector-line-detected {
  background: rgba(31, 38, 49, 0.4);
}

.detector-line-action {
  background: rgba(32, 46, 39, 0.35);
  border-color: rgba(77, 132, 95, 0.45);
}

.detector-line-why {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
}

.detector-line-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aab6c7;
  font-weight: 700;
}

.detector-line-text {
  color: #eef2f8;
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: min(320px, calc(100vw - 16px));
  background: #12161d;
  border: 1px solid #2f3744;
  border-radius: 10px;
  padding: 9px 10px;
  color: #dbe2ec;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  max-height: calc(100vh - 16px);
  overflow: auto;
}

.hidden {
  display: none !important;
}

.psych-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--psych-radius-md);
  background: linear-gradient(135deg, rgba(22, 26, 34, 0.92), rgba(15, 18, 25, 0.96));
  border: 1px solid var(--psych-line);
  min-height: 82px;
}

.skeleton-card--lg {
  min-height: 120px;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.12), transparent);
  animation: psychShimmer 1.35s infinite;
}

@keyframes psychShimmer {
  100% { transform: translateX(100%); }
}

@media (min-width: 760px) {
  .psych-page {
    padding: 24px 18px 36px;
    gap: 18px;
  }

  .psych-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 22px;
  }

  .psych-back {
    width: auto;
    min-width: 170px;
  }

  .psych-guest-cta {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

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

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

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

  .mini-chart-shell {
    overflow: visible;
    padding-bottom: 0;
    margin-top: 14px;
    scroll-snap-type: none;
  }

  .mini-chart-scroll {
    display: none;
  }

  .mini-chart {
    width: 100%;
    min-width: 0;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .psych-desktop-only {
    display: none;
  }

  .psych-mobile-only {
    display: inline-flex;
  }

  .psych-nav-flex {
    gap: 12px;
  }

  .psych-btn-nav {
    display: none;
  }

  .mini-chart {
    gap: 6px;
    min-height: 190px;
  }

  .mini-chart-value {
    font-size: 10px;
  }

  .mini-chart-track {
    min-height: 110px;
  }

  .mini-chart-label {
    font-size: 9px;
  }

  .detector-metrics {
    grid-template-columns: 1fr;
  }

  .signal-meter__head {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
