﻿html,
body {
  overflow-x: hidden;
}

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

.psych-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #272b35;
}

.psych-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
}

.psych-header h1 {
  margin: 0;
  font-size: 28px;
  color: var(--gold);
}

.psych-subtitle {
  margin: 8px 0 0;
  color: #b7bec8;
  font-size: 13px;
}

.psych-back {
  width: 100%;
}

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

.mindstate-card {
  border: 1px solid #2a313b;
  background: linear-gradient(160deg, rgba(22, 24, 29, 1), rgba(16, 19, 25, 0.98));
}

.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: 14px;
  padding: 8px 14px;
}

.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: 0;
  color: #c2c9d2;
  font-size: 13px;
}

.mindstate-trigger {
  margin: 0;
  color: #9ca9ba;
  font-size: 12px;
}

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

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

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

.section-info-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #394150;
  color: #c2cad6;
  background: #1a1e26;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

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

.detector-card {
  border: 1px solid #27303a;
  border-radius: 14px;
  background: var(--bg-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

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

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

.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: #9ca9ba;
  font-size: 12px;
}

.detector-line {
  margin: 0;
  color: #d7dde6;
  font-size: 13px;
  line-height: 1.35;
}

.detector-line strong {
  color: #f0f3f8;
}

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

.tooltip-btn {
  width: 19px;
  height: 19px;
  border-radius: 999px;
  border: 1px solid #384251;
  background: #1a2029;
  color: #b8c2d0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.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-empty h2 {
  font-size: 20px;
}

.psych-empty p {
  color: var(--gray);
}

.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: 14px;
  background: #16181d;
  border: 1px solid #252a33;
  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(255, 255, 255, 0.08), transparent);
  animation: psychShimmer 1.35s infinite;
}

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

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

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

  .psych-back {
    width: auto;
  }

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