/* SOMA Goals component — styles (uses the site's CSS variables) */

.soma-goals { max-width: 720px; }

.sg-add-form {
  background: var(--white, #fff);
  border: 1px solid var(--border, #d0d8e0);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sg-add-title,
.sg-add-desc {
  border: 1px solid var(--border, #d0d8e0);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-dark, #1a1a1a);
  width: 100%;
  box-sizing: border-box;
}
.sg-add-title:focus,
.sg-add-desc:focus { outline: 2px solid var(--gold, #c9a84c); outline-offset: 1px; }
.sg-add-desc { resize: vertical; }
.sg-add-btn {
  align-self: flex-start;
  background: var(--navy, #060e18);
  color: var(--gold, #c9a84c);
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.sg-add-btn:hover { opacity: 0.85; }
.sg-add-btn:disabled { opacity: 0.4; cursor: default; }
.sg-add-status { font-size: 0.82rem; color: var(--text-light, #777); }
.sg-add-status.err { color: #c0392b; }

.sg-signin-note { color: var(--text-light, #777); font-size: 0.9rem; margin-bottom: 18px; }

.sg-empty {
  color: var(--text-light, #777);
  font-size: 0.92rem;
  padding: 22px;
  text-align: center;
  border: 1px dashed var(--border, #d0d8e0);
  border-radius: 12px;
}

.sg-list { list-style: none; margin: 0; padding: 0; }

.sg-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #d0d8e0);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s;
}
.sg-item:hover { box-shadow: var(--shadow, 0 4px 24px rgba(6,14,24,0.16)); }
.sg-item.sg-pending {
  border-style: dashed;
  background: var(--gold-pale, #f5e9c5);
}
.sg-item.sg-dragging { opacity: 0.5; }

.sg-handle {
  cursor: grab;
  color: var(--text-light, #777);
  font-size: 1.1rem;
  line-height: 1.4;
  user-select: none;
  padding-top: 2px;
}
.sg-handle:active { cursor: grabbing; }

.sg-body { flex: 1; min-width: 0; }
.sg-title {
  font-weight: 600;
  color: var(--navy, #060e18);
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sg-badge {
  display: inline-block;
  background: var(--gold-dark, #8a6d1c);
  color: var(--white, #fff);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
}
.sg-desc { color: var(--text-dark, #333); font-size: 0.88rem; margin-top: 4px; line-height: 1.5; }
.sg-meta { color: var(--text-light, #777); font-size: 0.76rem; margin-top: 6px; }

.sg-approve {
  align-self: center;
  background: #065f46;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.sg-approve:hover { opacity: 0.85; }
.sg-approve:disabled { opacity: 0.45; cursor: default; }

/* ── Committee view toggle (My order ↔ Consensus) ───────────────────────── */
.sg-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border, #d0d8e0);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 18px;
  background: var(--white, #fff);
  gap: 2px;
}
.sg-view-btn {
  border: none;
  background: transparent;
  color: var(--text-light, #777);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sg-view-btn:hover { color: var(--navy, #060e18); }
.sg-view-btn.is-active {
  background: var(--navy, #060e18);
  color: var(--gold, #c9a84c);
}

/* ── Consensus view ─────────────────────────────────────────────────────── */
.sg-consensus { max-width: 720px; }

.sg-consensus-head { margin-bottom: 14px; }
.sg-w-headline {
  font-size: 1.02rem;
  color: var(--navy, #060e18);
}
.sg-w-headline strong { font-weight: 700; }
.sg-w-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 9px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}
.sg-w-strong { background: #065f46; color: #fff; }
.sg-w-moderate { background: var(--gold-dark, #8a6d1c); color: #fff; }
.sg-w-weak { background: #b45309; color: #fff; }
.sg-w-n\/a { background: var(--border, #d0d8e0); color: var(--text-dark, #333); }
.sg-consensus-sub {
  color: var(--text-light, #777);
  font-size: 0.82rem;
  margin-top: 4px;
}

.sg-cycle-note {
  background: var(--gold-pale, #f5e9c5);
  border: 1px solid var(--gold-dark, #8a6d1c);
  border-radius: 8px;
  color: var(--text-dark, #333);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.sg-scale {
  display: flex;
  justify-content: space-between;
  color: var(--text-light, #777);
  font-size: 0.72rem;
  margin: 0 0 6px 40px;
}

.sg-consensus-list { list-style: none; margin: 0; padding: 0; }

.sg-consensus-item {
  background: var(--white, #fff);
  border: 1px solid var(--border, #d0d8e0);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.sg-consensus-item.sg-split { border-left: 3px solid var(--gold-dark, #8a6d1c); }
.sg-consensus-item.sg-agreed { border-left: 3px solid #065f46; }

.sg-consensus-row { display: flex; align-items: flex-start; gap: 12px; }
.sg-rank {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy, #060e18);
  color: var(--gold, #c9a84c);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-consensus-main { flex: 1; min-width: 0; }
.sg-consensus-title {
  font-weight: 600;
  color: var(--navy, #060e18);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

/* Distribution band: track 1..n, Q1–Q3 box, median marker, member dots. */
.sg-band {
  position: relative;
  height: 26px;
  margin-bottom: 4px;
}
.sg-band-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  transform: translateY(-50%);
  background: var(--border, #d0d8e0);
  border-radius: 2px;
}
.sg-band-box {
  position: absolute;
  top: 50%;
  height: 12px;
  transform: translateY(-50%);
  background: rgba(201, 168, 76, 0.35); /* gold, translucent */
  border: 1px solid var(--gold-dark, #8a6d1c);
  border-radius: 4px;
  min-width: 2px;
}
.sg-band-median {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: var(--navy, #060e18);
  border-radius: 1px;
}
.sg-band-dot {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--navy, #060e18);
  border: 1.5px solid var(--white, #fff);
  box-shadow: 0 0 0 1px rgba(6, 14, 24, 0.25);
}

.sg-contested {
  text-align: center;
  margin: 6px 0 0 38px;
  border-top: 1px dashed var(--gold-dark, #8a6d1c);
  position: relative;
}
.sg-contested span {
  display: inline-block;
  position: relative;
  top: -9px;
  background: var(--white, #fff);
  color: var(--gold-dark, #8a6d1c);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 8px;
}

.sg-consensus-empty { margin-top: 4px; }

/* ── "Bill hint" thought bubble (committee-only) ─────────────────────────────
 * A small speech bubble that floats just above the "Ask Bill" guide FAB. It is
 * created/destroyed by js/soma-goals.js and appended to <body>. Fixed-position,
 * bottom-right by default; when a .sg-fab is present the JS sets inline
 * right/bottom to anchor it above that button (and adds --anchored). The FAB
 * lives at a high z-index, so we sit just above it. */
.sg-bill-hint {
  position: fixed;
  right: 24px;
  bottom: 92px; /* default: clear of a bottom-right FAB when not anchored */
  z-index: 2147483000; /* above the guide FAB and page content */
  max-width: 270px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #d0d8e0);
  border-left: 3px solid var(--gold, #c9a84c);
  border-radius: 12px;
  padding: 12px 12px 12px 14px;
  box-shadow: var(--shadow, 0 4px 24px rgba(6, 14, 24, 0.16));
  /* Entrance: start translated down + faded, transition to is-in. */
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
}
.sg-bill-hint.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Little tail/pointer toward the FAB (lower-right corner of the bubble). */
.sg-bill-hint::after {
  content: '';
  position: absolute;
  right: 22px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: var(--white, #fff);
  border-right: 1px solid var(--border, #d0d8e0);
  border-bottom: 1px solid var(--border, #d0d8e0);
  transform: rotate(45deg);
}

.sg-bill-hint-body {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--navy, #060e18);
}
.sg-bill-hint-body:hover { color: var(--gold-dark, #8a6d1c); }
.sg-bill-hint-body:focus-visible { outline: 2px solid var(--gold, #c9a84c); outline-offset: 2px; }

.sg-bill-hint-close {
  flex: 0 0 auto;
  border: none;
  background: var(--gold-pale, #f5e9c5);
  color: var(--navy, #060e18);
  width: 20px;
  height: 20px;
  line-height: 18px;
  border-radius: 50%;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.sg-bill-hint-close:hover { background: var(--gold, #c9a84c); }
.sg-bill-hint-close:focus-visible { outline: 2px solid var(--gold, #c9a84c); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  .sg-bill-hint {
    transition: opacity 0.001s linear;
    transform: none;
  }
  .sg-bill-hint.is-in { transform: none; }
}
