/* v45 — sobivuspõhine värviloogika ja laiendatud hirmuprotokollid */

.v45-coherence .coherence-choice,
.scene[data-step-type="healthFearGuidance"] .fear-protocol-card,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card,
.scene[data-step-type="healthFearGuidance"] .fear-payload-card {
  border: 1px solid rgba(83, 207, 255, .48) !important;
  background-image:
    linear-gradient(145deg, rgba(5, 48, 83, .94), rgba(1, 20, 44, .98)),
    var(--hud-panel-card) !important;
  background-color: rgba(2, 21, 45, .94) !important;
}

.v45-coherence .fit-excellent,
.scene[data-step-type="healthFearGuidance"] .fit-excellent {
  border-color: rgba(103, 244, 187, .78) !important;
  box-shadow: inset 0 0 .9cqw rgba(76, 235, 185, .13), 0 0 .36cqw rgba(76, 235, 185, .18);
}

.v45-coherence .fit-good,
.scene[data-step-type="healthFearGuidance"] .fit-good {
  border-color: rgba(77, 225, 222, .7) !important;
  box-shadow: inset 0 0 .75cqw rgba(67, 220, 255, .1);
}

.v45-coherence .fit-fair,
.scene[data-step-type="healthFearGuidance"] .fit-fair {
  border-color: rgba(83, 176, 255, .64) !important;
}

.v45-coherence .fit-low,
.scene[data-step-type="healthFearGuidance"] .fit-low {
  border-color: rgba(125, 158, 188, .52) !important;
  filter: saturate(.78);
}

.v45-coherence .fit-excellent small b,
.scene[data-step-type="healthFearGuidance"] .fit-excellent small b { color: #83f6ca; }
.v45-coherence .fit-good small b,
.scene[data-step-type="healthFearGuidance"] .fit-good small b { color: #77ece9; }
.v45-coherence .fit-fair small b,
.scene[data-step-type="healthFearGuidance"] .fit-fair small b { color: #8cc9ff; }
.v45-coherence .fit-low small b,
.scene[data-step-type="healthFearGuidance"] .fit-low small b { color: #aabfd1; }

.v45-coherence .coherence-role-icon {
  filter: grayscale(1) sepia(.2) hue-rotate(145deg) saturate(2.5) brightness(1.28);
}

.v45-coherence .coherence-bar i {
  background: linear-gradient(90deg, #378eff, #67e7ff, #77f0cb) !important;
}

.v45-coherence .overload .coherence-bar i {
  background: linear-gradient(90deg, #378eff, #67e7ff, #77f0cb) !important;
}

.v45-coherence .coherence-choice small {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .2cqw .45cqw;
  color: #b8d8e7 !important;
}

.v45-coherence .risk-note {
  display: inline-flex;
  padding: .1cqw .32cqw;
  border: 1px solid rgba(255, 112, 104, .65);
  border-radius: 999px;
  background: rgba(89, 13, 25, .72);
  color: #ffaaa5;
  font-style: normal;
  font-weight: 950;
  letter-spacing: .04em;
}

.scene[data-step-type="healthFearGuidance"] .health-guidance-shell,
.scene[data-step-type="healthFearGuidance"] .fear-path-shell,
.scene[data-step-type="healthFearGuidance"] .phrase-editor,
.scene[data-step-type="healthFearGuidance"] .combined-message-review {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.scene[data-step-type="healthFearGuidance"] .health-guidance-shell,
.scene[data-step-type="healthFearGuidance"] .fear-path-shell {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: .34cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .guidance-grid,
.scene[data-step-type="healthFearGuidance"] .fear-protocol-grid,
.scene[data-step-type="healthFearGuidance"] .fear-channel-grid {
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: .3cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .guidance-grid > :last-child:nth-child(odd),
.scene[data-step-type="healthFearGuidance"] .fear-protocol-grid > :last-child:nth-child(odd),
.scene[data-step-type="healthFearGuidance"] .fear-channel-grid > :last-child:nth-child(odd),
.scene[data-step-type="healthFearGuidance"] .fear-payload-grid > :last-child:nth-child(odd),
.scene[data-step-type="healthFearGuidance"] .phrase-grid:not(.fear-payload-grid) > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.scene[data-step-type="healthFearGuidance"] .fear-protocol-card,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card {
  min-height: 0 !important;
  height: 100%;
  align-content: center;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: .38cqw !important;
  row-gap: .1cqw !important;
  padding: .3cqw .4cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .fear-protocol-card > img,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card > img {
  grid-row: 1 / 4;
  align-self: center;
}

.scene[data-step-type="healthFearGuidance"] .fear-protocol-card > strong,
.scene[data-step-type="healthFearGuidance"] .fear-protocol-card > span,
.scene[data-step-type="healthFearGuidance"] .fear-protocol-card > small,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card > strong,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card > span,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card > small {
  grid-column: 2;
}

.scene[data-step-type="healthFearGuidance"] .fear-protocol-card strong,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card strong {
  font-size: clamp(10px, .66cqw, 13px) !important;
}

.scene[data-step-type="healthFearGuidance"] .fear-protocol-card span,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card span {
  font-size: clamp(8px, .51cqw, 10px) !important;
  line-height: 1.14 !important;
}

.scene[data-step-type="healthFearGuidance"] .fear-protocol-card small,
.scene[data-step-type="healthFearGuidance"] .fear-channel-card small {
  font-size: clamp(8px, .49cqw, 9.5px) !important;
}

.scene[data-step-type="healthFearGuidance"] .phrase-editor {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: .32cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .phrase-grid {
  min-height: 0;
  overflow: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: .28cqw !important;
  padding-right: .12cqw;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 221, 255, .56) rgba(2, 23, 46, .4);
}

.scene[data-step-type="healthFearGuidance"] .phrase-choice {
  min-height: 0;
  height: 100%;
  align-content: center;
  gap: .12cqw !important;
  padding: .3cqw .4cqw !important;
  border-radius: .45cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .phrase-choice > strong {
  color: #fff;
  font-size: clamp(9.5px, .62cqw, 12px) !important;
  line-height: 1.1;
}

.scene[data-step-type="healthFearGuidance"] .phrase-choice > span {
  font-size: clamp(8.5px, .54cqw, 10.5px) !important;
  line-height: 1.18 !important;
  font-weight: 720;
}

.scene[data-step-type="healthFearGuidance"] .phrase-choice > small {
  font-size: clamp(7.5px, .47cqw, 9px) !important;
}

.scene[data-step-type="healthFearGuidance"] .payload-source {
  display: block;
  color: #76d9f7;
  font-size: clamp(7px, .44cqw, 8.5px);
  font-style: normal;
  font-weight: 900;
  letter-spacing: .045em;
}

.scene[data-step-type="healthFearGuidance"] .guidance-summary {
  gap: .1cqw !important;
  padding: .34cqw .44cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .guidance-summary b {
  font-size: clamp(10px, .68cqw, 13px) !important;
}

.scene[data-step-type="healthFearGuidance"] .guidance-summary span,
.scene[data-step-type="healthFearGuidance"] .guidance-summary small {
  font-size: clamp(8px, .5cqw, 9.5px) !important;
  line-height: 1.18 !important;
}

.scene[data-step-type="healthFearGuidance"] .combined-message-review {
  grid-template-rows: minmax(0, 1fr) auto auto !important;
  gap: .34cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .combined-review-grid {
  min-height: 0;
  gap: .34cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .combined-review-grid > div {
  min-height: 0;
  overflow: auto;
  padding: .38cqw .44cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .packet-resolution-note {
  gap: .14cqw !important;
  padding: .34cqw .42cqw !important;
}

.scene[data-step-type="healthFearGuidance"] .packet-resolution-note > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: .45cqw;
}

.scene[data-step-type="healthFearGuidance"] .packet-resolution-note strong,
.scene[data-step-type="healthFearGuidance"] .packet-resolution-note span {
  font-size: clamp(8px, .51cqw, 10px) !important;
}

.fear-integration-meter {
  height: .45cqw;
  min-height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(122, 175, 201, .18);
}

.fear-integration-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #378eff, #67e7ff, #77f0cb);
  box-shadow: 0 0 .45cqw rgba(83, 216, 255, .45);
}

.packet-resolution-note.status-resolved {
  border-color: rgba(103, 244, 187, .62);
  background: rgba(3, 64, 56, .52);
}

.packet-resolution-note.status-deferred {
  border-color: rgba(128, 168, 201, .56);
  background: rgba(16, 35, 58, .72);
}

@container (max-width: 760px) {
  .scene[data-step-type="healthFearGuidance"] .fear-protocol-card span,
  .scene[data-step-type="healthFearGuidance"] .fear-channel-card span {
    display: none;
  }

  .scene[data-step-type="healthFearGuidance"] .fear-protocol-card,
  .scene[data-step-type="healthFearGuidance"] .fear-channel-card {
    grid-template-rows: auto auto;
  }

  .scene[data-step-type="healthFearGuidance"] .fear-protocol-card > img,
  .scene[data-step-type="healthFearGuidance"] .fear-channel-card > img {
    grid-row: 1 / 3;
  }
}
