/* Results Assistant panel, shared across GeoPlatform views. */
body.care-guide-open {
  overflow: hidden;
}

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

.care-guide-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, #0b706f, #183249 78%);
  color: #ffffff;
  padding: 9px 16px 9px 10px;
  box-shadow: 0 16px 38px rgba(19, 45, 63, 0.28);
  text-align: left;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.care-guide-launcher:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(19, 45, 63, 0.34);
}

.care-guide-launcher:focus-visible,
.care-guide-panel button:focus-visible,
.care-guide-panel textarea:focus-visible {
  outline: 3px solid #f3c96e;
  outline-offset: 2px;
}

.care-guide-launcher-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.14);
}

.care-guide-launcher-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.care-guide-launcher-icon circle {
  fill: currentColor;
  stroke: none;
}

.care-guide-launcher strong,
.care-guide-launcher small {
  display: block;
}

.care-guide-launcher strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.care-guide-launcher small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.69rem;
}

.care-guide-scrim {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(12, 26, 38, 0.28);
  opacity: 0;
  backdrop-filter: blur(1.5px);
  transition: opacity 180ms ease;
}

.care-guide-scrim.open {
  opacity: 1;
}

.care-guide-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(430px, calc(100vw - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid rgba(24, 50, 73, 0.18);
  border-radius: 22px;
  background: #f7fafb;
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(11, 32, 48, 0.34);
  opacity: 0;
  transform: translateX(calc(100% + 40px));
  visibility: hidden;
  transition:
    transform 220ms ease,
    opacity 180ms ease,
    visibility 220ms;
}

.care-guide-panel.open {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
}

.care-guide-header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 16px 14px;
  background:
    radial-gradient(
      circle at 90% 20%,
      rgba(243, 201, 110, 0.18),
      transparent 36%
    ),
    linear-gradient(135deg, #0d696d, #183249);
  color: #ffffff;
}

.care-guide-identity {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.care-guide-avatar,
.care-guide-message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #f3c96e;
  color: #183249;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.care-guide-avatar {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: 0 5px 16px rgba(5, 25, 40, 0.2);
}

.care-guide-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.care-guide-title-row h2 {
  font-size: 1.08rem;
}

.care-guide-status {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.care-guide-header p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.74rem;
  line-height: 1.35;
}

.care-guide-close {
  min-width: 36px;
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0 0 3px;
  font-size: 1.5rem;
  line-height: 1;
}

.care-guide-close:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
}

.care-guide-context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  background: #edf5f4;
  padding: 9px 16px;
  color: #47606c;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.care-guide-context span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.care-guide-context-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #168579;
  box-shadow: 0 0 0 3px rgba(22, 133, 121, 0.14);
}

.care-guide-messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 8px;
  scroll-behavior: smooth;
}

.care-guide-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.care-guide-message.user {
  justify-content: flex-end;
  padding-left: 54px;
}

.care-guide-message-avatar {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 9px;
  font-size: 0.63rem;
}

.care-guide-bubble {
  min-width: 0;
  max-width: calc(100% - 36px);
  border: 1px solid #dbe4e9;
  border-radius: 5px 16px 16px;
  background: #ffffff;
  padding: 12px 13px;
  box-shadow: 0 3px 12px rgba(24, 50, 73, 0.06);
}

.care-guide-message.user .care-guide-bubble {
  border-color: #0d6b70;
  border-radius: 16px 5px 16px 16px;
  background: #0d6b70;
  color: #ffffff;
  padding: 10px 12px;
}

.care-guide-bubble h3 {
  margin: 0 0 7px;
  color: #183249;
  font-size: 0.91rem;
  line-height: 1.32;
}

.care-guide-bubble p {
  margin: 0 0 8px;
  color: #42566a;
  font-size: 0.79rem;
  line-height: 1.52;
}

.care-guide-bubble p:last-child {
  margin-bottom: 0;
}

.care-guide-message.user .care-guide-bubble p {
  color: #ffffff;
}

.care-guide-bubble ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #42566a;
  font-size: 0.76rem;
  line-height: 1.46;
}

.care-guide-bubble li + li {
  margin-top: 5px;
}

.care-guide-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 11px 0 8px;
}

.care-guide-facts div {
  min-width: 0;
  border: 1px solid #dce7e9;
  border-radius: 9px;
  background: #f3f8f8;
  padding: 8px;
}

.care-guide-facts dt {
  color: #607185;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.care-guide-facts dd {
  margin: 3px 0 0;
  color: #123e48;
  font-size: 0.93rem;
  font-weight: 800;
}

.care-guide-disclaimer {
  margin-top: 10px !important;
  border-left: 3px solid #d89a38;
  border-radius: 0 7px 7px 0;
  background: #fff8e8;
  padding: 7px 8px;
  color: #684f20 !important;
  font-size: 0.68rem !important;
  line-height: 1.42 !important;
}

.care-guide-actions,
.care-guide-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.care-guide-actions button,
.care-guide-followups button {
  min-height: 31px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.68rem;
  line-height: 1.25;
}

.care-guide-actions button {
  border-color: #0d6b70;
  background: #0d6b70;
  color: #ffffff;
}

.care-guide-actions button:disabled {
  border-color: #a8b9c0;
  background: #e5ecef;
  color: #607185;
  cursor: default;
}

.care-guide-followups button {
  border-color: #b9d5d3;
  background: #edf7f6;
  color: #175e61;
}

.care-guide-sources {
  margin-top: 10px;
  border-top: 1px solid #e1e8ec;
  padding-top: 8px;
}

.care-guide-sources summary {
  color: #426978;
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
}

.care-guide-sources ul {
  margin-top: 7px;
  padding-left: 0;
  list-style: none;
}

.care-guide-sources li {
  border-left: 2px solid #9ec8c4;
  padding-left: 7px;
}

.care-guide-sources strong,
.care-guide-sources span {
  display: block;
}

.care-guide-sources strong {
  color: #284a56;
  font-size: 0.67rem;
}

.care-guide-sources span {
  margin-top: 2px;
  color: #6a7c8d;
  font-size: 0.62rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.care-guide-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.78);
}

.care-guide-starters[hidden] {
  display: none;
}

.care-guide-starters button {
  appearance: none;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d5e5ea;
  border-radius: 8px;
  background: #f5fafb;
  color: #315664;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  box-shadow: none;
  transition: background 150ms ease, border-color 150ms ease;
}

.care-guide-starters button:hover {
  border-color: #8fbfc8;
  background: #eaf6f8;
}

.care-guide-form {
  display: block;
  min-width: 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
  padding: 14px 16px 12px;
}

.care-guide-input-label {
  display: block;
  margin-bottom: 8px;
  color: #294b60;
  font-size: 12px;
  font-weight: 650;
}

.care-guide-composer {
  position: relative;
  min-width: 0;
  width: 100%;
  border: 1px solid #bdcfd9;
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.care-guide-composer:focus-within {
  border-color: #138a99;
  box-shadow: 0 0 0 3px #138a991a;
}

.care-guide-form textarea {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 80px;
  max-height: 160px;
  margin: 0;
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  padding: 13px 62px 13px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.care-guide-form textarea::placeholder {
  color: #7a8997;
}

.care-guide-composer > button {
  appearance: none;
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #087e8e;
  color: #ffffff;
  padding: 0;
}

.care-guide-composer > button:hover:not(:disabled) {
  background: #0a585d;
}

.care-guide-composer > button:disabled {
  background: #e8f0f4;
  color: #8a9fab;
  opacity: 1;
  cursor: default;
}

.care-guide-form.busy .care-guide-composer > button {
  cursor: wait;
}

.care-guide-form svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.care-guide-input-hint {
  margin: 8px 0 0;
  color: #718698;
  font-size: 10px;
  line-height: 1.4;
}

.care-guide-footer {
  display: grid;
  gap: 4px;
  border-top: 1px solid #e2ebf0;
  background: #edf2f4;
  padding: 10px 16px 12px;
  color: #70808e;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .care-guide-launcher {
    right: 12px;
    bottom: 12px;
    min-height: 52px;
    border-radius: 16px;
    padding: 7px 13px 7px 8px;
  }

  .care-guide-launcher-icon {
    width: 37px;
    height: 37px;
  }

  .care-guide-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(88dvh, 760px);
    border-radius: 22px 22px 0 0;
    transform: translateY(calc(100% + 20px));
  }

  .care-guide-panel.open {
    transform: translateY(0);
  }

  .care-guide-footer {
    padding-bottom: max(7px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .care-guide-launcher,
  .care-guide-panel,
  .care-guide-scrim {
    transition: none;
  }

  .care-guide-messages {
    scroll-behavior: auto;
  }
}

/* Aim 2 v2 proposal-grade summary panel */
#aim2V2PanelWrap {
  margin-bottom: 1.25rem;
}
.aim2-command-panel.proposal-grade {
  border-left: 3px solid #0e6655;
}
.v2-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.v2-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.v2-stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.7;
}
.v2-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}
.v2-stat-note {
  font-size: 0.74rem;
  opacity: 0.72;
}
.v2-block {
  margin-top: 0.85rem;
}
.v2-block h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
  margin: 0 0 0.4rem;
}
.v2-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.v2-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  padding-bottom: 0.24rem;
}
.v2-list li span {
  opacity: 0.85;
}
.v2-list strong.delta-worse {
  color: #e06a5a;
}
.v2-list strong.delta-better {
  color: #57b894;
}
.v2-scope {
  font-size: 0.76rem;
  opacity: 0.62;
  margin-top: 0.9rem;
  line-height: 1.5;
}

/* ---- Plain-language mode + Analyst toggle ---- */
body:not(.analyst-mode) .analyst-only {
  display: none !important;
}
.header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}
.analyst-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  opacity: 0.85;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.analyst-switch input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.map-help {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  opacity: 0.75;
  max-width: 46ch;
  line-height: 1.45;
}
.band-help {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  opacity: 0.8;
  line-height: 1.5;
  max-width: 80ch;
}

/* ---- Plain detail card ---- */
.detail-plain {
  background: rgba(87, 184, 148, 0.08);
  border: 1px solid rgba(87, 184, 148, 0.22);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0 1rem;
}
.plain-summary {
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  line-height: 1.55;
}
.plain-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}
.plain-facts div {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.plain-facts span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.65;
}
.plain-facts strong {
  font-size: 1.05rem;
  text-transform: capitalize;
}
.plain-help-line {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.92;
}
.detail-id {
  font-size: 0.72rem;
  opacity: 0.5;
  margin: 0.1rem 0 0;
}

/* Aim 2 v2 plain driver importance bars */
.reason-bar {
  display: block;
  width: 90px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.reason-bar u {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #57b894, #df8c3f);
}
.scenario-row em.delta-better {
  color: #57b894;
}
.scenario-row em.delta-worse {
  color: #e06a5a;
}
