/* ═══════════════════════════════════════
   WOBAZI — Relationships (people, pair readings, invites, public pages)
   app/relationships.css
   Uses the app tokens from style.css only (light mode follows automatically).
═══════════════════════════════════════ */

/* Person page open: only the People section shows on the Relationships tab. */
#results.rel-detail-open .section[data-tab="relationships"]:not(#res-rel-people),
#results.rel-detail-open #toc-relationships { display: none !important; }

/* ── Cards, text ── */
.rel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rel-card-title { font-size: 16px; font-weight: 700; color: var(--text); }
.rel-muted { font-size: 13px; line-height: 1.5; color: var(--muted); }
.rel-sub { margin-top: -4px; }
.rel-pad { padding: 12px 4px; }
.rel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.rel-name { font-weight: 600; color: var(--text); }
.rel-empty { align-items: stretch; }
.rel-empty .btn-primary { margin-top: 6px; }
.rel-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 100px;
  background: var(--w06);
  border: 1px solid var(--border);
  color: var(--m7);
  white-space: nowrap;
}
.rel-chip-btn { gap: 5px; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rel-chip-btn:hover { border-color: var(--gold-dim); }
.rel-chip-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.rel-chip-caret { font-size: 9px; opacity: 0.7; }
.rel-chip-linked { color: var(--gold); border-color: var(--gold-dim); background: var(--gold-dim); }

#res-rel-people > .section-head {
  padding: 0;
  margin: 0 0 14px;
}
.rel-linked-panel {
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
  background: color-mix(in srgb, var(--gold) 7%, var(--bg));
  animation: rel-gold-in 400ms ease-out;
  overflow: hidden;
}
.rel-saved-panel { margin-bottom: 8px; }
.rel-group-head { padding: 16px 16px 10px; }
.rel-saved-panel .rel-group-head { padding: 0 0 10px; }
.rel-list-linked { padding: 0 16px 12px; margin-bottom: 0; }
.rel-group-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.rel-group-sub { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin: 0; }
.rel-list-linked { gap: 10px; }
.rel-row-linked {
  background: color-mix(in srgb, var(--gold) 6%, var(--bg-card));
  border-color: color-mix(in srgb, var(--gold) 28%, var(--border));
  align-items: flex-start;
}
.rel-saved-panel .rel-row { background: var(--w03); }
.rel-lockup {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--gold);
  letter-spacing: 0.02em;
}
.rel-lockup-dots {
  width: 16px; height: 8px; position: relative; flex: 0 0 16px;
}
.rel-lockup-dots::before, .rel-lockup-dots::after {
  content: ''; position: absolute; top: 1px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
}
.rel-lockup-dots::before { left: 0; }
.rel-lockup-dots::after { right: 0; opacity: 0.65; }
.rel-pulse { display: flex; align-items: flex-end; gap: 3px; height: 22px; flex: 0 0 auto; padding-top: 4px; }
.rel-pulse-meter {
  display: block; width: 4px; height: 22px; border-radius: 3px;
  background: var(--w08); overflow: hidden;
}
.rel-pulse-meter > span {
  display: block; width: 100%; border-radius: 3px; background: var(--gold);
}
.rel-linked-lockup {
  margin: 0 2px 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--border));
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}
.rel-linked-kicker { font-size: 14px; font-weight: 700; color: var(--gold); margin: 0 0 4px; }
.rel-linked-live { font-size: 13px; color: var(--m85); margin: 0 0 6px; }
@keyframes rel-gold-in {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent); }
  40% { box-shadow: 0 0 18px 0 color-mix(in srgb, var(--gold) 28%, transparent); }
  to { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rel-linked-panel { animation: none; }
}

/* ── List ── */
.rel-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.rel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: background 0.2s;
}
.rel-row:active { background: var(--w06); }
.rel-avatar {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  background: var(--w07);
  color: var(--text);
}
.rel-avatar-img { position: relative; overflow: hidden; }
.rel-avatar-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rel-avatar-img::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inherit; pointer-events: none; }
.rel-avatar[data-el="Wood"] { box-shadow: inset 0 0 0 2px var(--el-wood); }
.rel-avatar[data-el="Fire"] { box-shadow: inset 0 0 0 2px var(--el-fire); }
.rel-avatar[data-el="Earth"] { box-shadow: inset 0 0 0 2px var(--el-earth); }
.rel-avatar[data-el="Metal"] { box-shadow: inset 0 0 0 2px var(--el-metal); }
.rel-avatar[data-el="Water"] { box-shadow: inset 0 0 0 2px var(--el-water); }
.rel-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rel-row-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rel-row-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.rel-row-line { font-size: 12.5px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-chev { flex: 0 0 auto; color: var(--m4); }

/* ── Skeletons ── */
.skel {
  display: block;
  height: 12px;
  border-radius: 6px;
  margin: 4px 0;
  background: linear-gradient(90deg, var(--w05) 0%, var(--w1) 50%, var(--w05) 100%);
  background-size: 200% 100%;
  animation: rel-shimmer 1.3s ease-in-out infinite;
}
.skel-w30 { width: 30%; } .skel-w40 { width: 40%; } .skel-w50 { width: 50%; }
.skel-w70 { width: 70%; } .skel-w80 { width: 80%; } .skel-w100 { width: 100%; }
.skel-h28 { height: 28px; margin: 8px 0; }
.skel-bar { height: 8px; width: 100%; margin-bottom: 14px; }
.skel-card { width: 100%; aspect-ratio: 1200 / 630; height: auto; border-radius: var(--radius-sm); }
.rel-skel { pointer-events: none; }
@keyframes rel-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ── Person page ── */
.rel-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--m7);
  padding: 6px 0 12px;
}
.rel-back-bottom { display: flex; justify-content: center; width: 100%; padding: 10px 0 4px; text-decoration: underline; text-underline-offset: 3px; }
.rel-person-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rel-person-head:has(+ .rel-linked-note) { margin-bottom: 8px; }
.rel-linked-note { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0 2px 14px; }
.rel-person-name { font-size: 22px; font-weight: 700; margin-right: 2px; overflow-wrap: anywhere; }
.rel-headline { gap: 8px; padding: 22px 18px; }
.rel-archetype-name {
  /* Same type as the Your Chart hero title (.you-hero-title). */
  font-size: 30px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--gold);
  margin: 0;
}
.rel-headline-desc { font-size: 15px; line-height: 1.6; color: var(--m85); }
.rel-watch {
  font-size: 14px;
  line-height: 1.55;
  color: var(--m8);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--w04);
  border-left: 2px solid var(--el-fire);
}
.rel-watch-label { font-weight: 700; color: var(--text); margin-right: 4px; }
.rel-confidence {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 2px 14px;
}
.rel-confidence::before { content: '◔ '; }
.rel-note { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.rel-note p { font-size: 13px; color: var(--m8); flex: 1 1 200px; }

/* Scorecard */
.rel-scorecard { gap: 18px; }
.rel-score { display: flex; flex-direction: column; gap: 7px; }
.rel-score-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rel-score-label { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rel-score-val { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rel-bar { height: 8px; border-radius: 8px; background: var(--w08); overflow: hidden; }
.rel-bar-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.rel-score-line { font-size: 13px; line-height: 1.5; color: var(--m7); }
.rel-dual { display: flex; gap: 14px; }
.rel-dual-item { flex: 1; display: flex; align-items: center; gap: 8px; }
.rel-dual-item .rel-muted { font-size: 11px; min-width: 52px; }
.rel-mini { flex: 1; height: 5px; border-radius: 5px; background: var(--w08); overflow: hidden; display: block; }
.rel-mini > span { display: block; height: 100%; background: var(--el-wood); border-radius: 5px; }
.rel-mini-clash > span { background: var(--el-fire); }

/* Friction map */
.rel-friction-map { gap: 12px; }
.rel-friction-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
  padding: 10px 12px 10px 12px;
  background: var(--w03);
  animation: rel-card-in 280ms ease both;
}
.rel-friction-cards { display: flex; flex-direction: column; gap: 8px; }
.rel-friction-cards .rel-friction-card:nth-child(1) { animation-delay: 0ms; }
.rel-friction-cards .rel-friction-card:nth-child(2) { animation-delay: 40ms; }
.rel-friction-cards .rel-friction-card:nth-child(3) { animation-delay: 80ms; }
.rel-friction-cards .rel-friction-card:nth-child(4) { animation-delay: 120ms; }
.rel-friction-cards .rel-friction-card:nth-child(5) { animation-delay: 160ms; }
.rel-friction-card[data-kind="clash"] { border-left-color: var(--el-fire); }
.rel-friction-card[data-kind="lock"] { border-left-color: var(--gold); }
.rel-friction-card[data-kind="pace"] { border-left-color: var(--el-water); }
.rel-friction-card[data-kind="excess"] { border-left-color: var(--el-earth); }
.rel-friction-card[data-kind="gap"] { border-left-color: var(--el-metal); }
.rel-friction-card summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.rel-friction-card summary::-webkit-details-marker { display: none; }
.rel-friction-card summary::after { content: '▾'; color: var(--m5); font-size: 12px; margin-top: 3px; }
.rel-friction-card[open] summary::after { transform: rotate(180deg); }
/* Title + subtitle stay stacked and visible even collapsed, so two cards that share a
   generic title (both "The sore spot") are still told apart at a glance. */
.rel-friction-head { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rel-friction-title { font-weight: 700; color: var(--text); font-size: 15px; line-height: 1.3; }
.rel-friction-where { font-size: 12.5px; line-height: 1.4; color: var(--m6); }
.rel-friction-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding-top: 1px; }
.rel-intensity {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 100px; white-space: nowrap;
}
.rel-intensity-high { color: var(--el-fire); background: color-mix(in srgb, var(--el-fire) 18%, transparent); }
.rel-intensity-mid { color: var(--gold); background: var(--gold-dim); }
.rel-intensity-low { color: var(--muted); background: var(--w06); }
.rel-friction-pillars { font-size: 11px; color: var(--muted); margin: 10px 0 8px; letter-spacing: 0.01em; }
.rel-tip { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--w04); margin: 6px 0; }
.rel-tip-label { font-weight: 700; color: var(--el-wood); margin-right: 4px; }
.rel-watch-mini { font-size: 13px; line-height: 1.5; color: var(--m8); margin: 0; }
@keyframes rel-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rel-friction-card { animation: none; }
}

/* Spouse Palace: each need sits in its own row next to the offer that answers it (an arrow
   between them), rather than four look-alike boxes in a flat grid with no stated connection. */
.rel-swap { display: flex; flex-direction: column; gap: 10px; }
.rel-swap-row { display: flex; align-items: stretch; gap: 8px; }
.rel-swap-cell { flex: 1 1 0; min-width: 0; border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.rel-swap-cell p:not(.rel-swap-label) { font-size: 13.5px; line-height: 1.5; color: var(--m85); }
.rel-swap-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
/* A need: the gap to be filled — outlined, no fill. */
.rel-swap-need { background: transparent; border: 1px dashed var(--border); }
.rel-swap-need .rel-swap-label { color: var(--muted); }
/* An offer: what fills it — warm gold tint so the eye reads it as the answer. */
.rel-swap-give { background: var(--gold-dim); border: 1px solid var(--gold-dim); }
.rel-swap-give .rel-swap-label { color: var(--gold); }
.rel-swap-arrow { flex: 0 0 auto; align-self: center; color: var(--gold); font-size: 16px; }
@media (max-width: 400px) {
  .rel-swap-row { flex-direction: column; }
  .rel-swap-arrow { align-self: flex-start; margin-left: 4px; transform: rotate(90deg); }
}
.rel-work-item { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.rel-work-item:first-of-type { border-top: 0; padding-top: 0; }
.rel-work-item p:not(.rel-muted) { font-size: 14px; line-height: 1.55; color: var(--m85); }
.rel-locked { opacity: 0.8; }

.rel-share-btn { margin: 6px 0 4px; }
.rel-manage { display: flex; justify-content: center; gap: 24px; padding: 14px 0 6px; }
.rel-link-btn { font-size: 13px; font-weight: 600; color: var(--m6); text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }
.rel-danger { color: #f0a0a0; }
body.light-mode .rel-danger { color: #b3261e; }

/* ── Sheets ── */
.rel-overlay { z-index: 1000; }   /* above the Oracle bar (900) */
.rel-sheet { max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.rel-sheet-body { padding: 8px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.rel-sheet-close {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 22px; line-height: 1; color: var(--m6); background: var(--w06);
}
.rel-sheet-title { font-size: 19px; font-weight: 700; color: var(--text); padding-right: 40px; }
.rel-choice { display: flex; flex-direction: column; gap: 10px; }
.rel-choice-btn {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 16px; border-radius: var(--radius-md);
  background: var(--w04); border: 1px solid var(--border); color: var(--text);
}
.rel-choice-btn:active { background: var(--w08); }
.rel-choice-btn-accent {
  background: linear-gradient(135deg, #f0c040, #e08020);
  border-color: transparent;
  color: #1a0a00;
  box-shadow: 0 4px 24px rgba(240,192,64,0.35);
}
.rel-choice-btn-accent .rel-muted { color: rgba(26,10,0,0.72); }
.rel-choice-btn-accent:active { background: linear-gradient(135deg, #e8b838, #d07018); }
.rel-choice-title { font-size: 15px; font-weight: 700; }
.rel-type-seg { display: flex; flex-wrap: wrap; width: 100%; border-radius: 18px; }
.rel-type-seg .cal-seg-btn { flex: 1 1 auto; justify-content: center; font-size: 12px; padding: 9px 10px; }
.rel-link-box { padding: 12px; border-radius: var(--radius-sm); background: var(--w05); border: 1px solid var(--border); overflow-wrap: anywhere; }
.rel-link-box code { font-size: 13px; color: var(--text); }
.rel-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-share-row .btn-secondary { padding: 10px 16px; font-size: 13px; text-decoration: none; }
.rel-share-preview img { width: 100%; height: auto; aspect-ratio: 1200 / 630; background: var(--w04); display: block; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.rel-toggle { font-size: 14px; }

.rel-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 100px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35); z-index: 1100;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
}
.rel-toast.show { opacity: 1; transform: translate(-50%, 0); }

.uname-gate {
  position: fixed; inset: 0; z-index: 4000;
  background: var(--bg);
  overflow: auto;
  overscroll-behavior-y: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 40px;
}
.uname-gate-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
}
.uname-preview { margin-top: 6px; word-break: break-all; }
.uname-b-list {
  margin: 0 0 8px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--m8);
  font-size: 15px;
  line-height: 1.5;
}
.uname-gate .rel-link-btn { margin-top: 4px; text-align: center; width: 100%; }
.uname-gate .btn-secondary { justify-content: center; }

.rel-incoming { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.rel-incoming-card {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-card));
  box-shadow: 0 8px 28px rgba(240,192,64,0.18);
  gap: 12px;
}
.rel-incoming-card .rel-card-title { font-size: 18px; }
.rel-incoming-card .btn-primary.btn-full { margin-top: 4px; }
.rel-incoming-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.rel-profile-id { display: flex; align-items: center; gap: 14px; }
.rel-profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border); background: var(--w07);
  flex: 0 0 72px;
}
.rel-profile-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 28px; color: var(--text);
}
.rel-profile-types { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rel-profile-types legend { padding: 0; margin-bottom: 4px; }
.rel-profile-type { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.rel-profile-type input { accent-color: var(--gold); }

/* ── Public pages: /r/:token, /i/:token, /u/:username ── */
.rel-public-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.rel-public-card { margin: 0; }
.rel-public-card img { width: 100%; height: auto; display: block; border-radius: var(--radius-md); border: 1px solid var(--border); }
.rel-public-copy { display: flex; flex-direction: column; gap: 10px; }
.rel-public-names { font-size: 15px; color: var(--m7); }
.rel-public-copy .rel-archetype-name { font-size: 30px; }
.rel-public-desc { font-size: 16px; line-height: 1.6; color: var(--m8); }
.rel-public .rel-scorecard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; margin: 8px 0; }
.rel-public-cta { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.rel-invite .bazi-mini-form { gap: 18px; }
.rel-invite .time-input { width: 100%; }
.rel-teaser-zodiac { font-size: 13px; font-weight: 600; color: var(--gold); margin: 0 0 12px; }
.rel-teaser-row { display: flex; align-items: center; gap: 16px; }
.rel-teaser-char {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 48px; font-weight: 700; line-height: 1;
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--w05); color: var(--gold);
}
.rel-teaser-char[data-el="Wood"] { color: var(--el-wood); }
.rel-teaser-char[data-el="Fire"] { color: var(--el-fire); }
.rel-teaser-char[data-el="Earth"] { color: var(--el-earth); }
.rel-teaser-char[data-el="Metal"] { color: var(--el-metal); }
.rel-teaser-char[data-el="Water"] { color: var(--el-water); }
.rel-teaser-name { font-size: 20px; font-weight: 700; color: var(--text); }
.rel-teaser-line { font-size: 15px; line-height: 1.55; color: var(--m85); }
.rel-sheet-body .field-date-block > .cal-seg,
.rel-invite .field-date-block > .cal-seg { align-self: flex-start; }
.rel-invite-title { font-size: 26px; line-height: 1.25; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.rel-public .btn-primary { text-decoration: none; }
html[data-lang="th"] .rel-kicker, html[data-lang="zh"] .rel-kicker { letter-spacing: 0.02em; }

/* ── Headline visuals: Day Master dynamic + element mix ── */
.rel-dyn {
  display: grid;
  grid-template-columns: 1fr minmax(90px, 1.3fr) 1fr;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  background: var(--w03);
  border: 1px solid var(--border);
}
.rel-orb { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.rel-orb-disc {
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--orb) 30%, transparent), color-mix(in srgb, var(--orb) 8%, transparent) 70%);
  box-shadow: inset 0 0 0 2px var(--orb), 0 0 22px color-mix(in srgb, var(--orb) 28%, transparent);
}
.rel-orb-char { font-family: 'Noto Sans SC', sans-serif; font-size: 28px; font-weight: 700; line-height: 1; color: var(--orb); }
.rel-orb-disc-img { position: relative; overflow: hidden; }
.rel-orb-disc-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rel-orb-who { font-size: 13px; font-weight: 700; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-orb-el { font-size: 11px; color: var(--muted); }
.rel-dyn-link { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gold); min-width: 0; }
.rel-dyn-label { font-size: 12px; font-weight: 700; color: var(--text); text-align: center; line-height: 1.25; }
.rel-dyn-arrow { display: block; overflow: visible; }
.rel-dyn-score { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.rel-mix { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.rel-mix-head {
  display: grid; grid-template-columns: 1fr 64px 1fr; align-items: baseline;
  font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 8px;
}
.rel-mix-head > span:first-child { text-align: right; padding-right: 6px; }
.rel-mix-head > span:last-child { padding-left: 6px; }
.rel-mix-title { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); text-align: center; margin: 0 0 8px; }
.rel-mix-rows { display: flex; flex-direction: column; gap: 6px; }
.rel-mix-row { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; border-radius: 6px; }
.rel-mix-row:hover { background: var(--w04); }
.rel-mix-side { display: flex; align-items: center; gap: 6px; height: 16px; min-width: 0; }
.rel-mix-you { justify-content: flex-end; }
.rel-mix-bar { display: block; height: 10px; background: var(--bar); min-width: 0; }
.rel-mix-you .rel-mix-bar { border-radius: 4px 0 0 4px; }
.rel-mix-them .rel-mix-bar { border-radius: 0 4px 4px 0; }
.rel-mix-val { font-size: 11px; color: var(--m7); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.rel-mix-el { font-size: 11px; font-weight: 600; color: var(--m8); text-align: center; }

.rel-perks { list-style: none; margin: 2px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rel-perks li { position: relative; padding-left: 20px; font-size: 13.5px; line-height: 1.45; color: var(--m85); }
.rel-perks li::before { content: '✦'; position: absolute; left: 0; top: 0; color: var(--gold); font-size: 12px; }
.rel-center { text-align: center; font-size: 12px; }
/* Keep the visuals compact on wide screens */
.rel-dyn { width: 100%; max-width: 480px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.rel-mix-title, .rel-mix-head, .rel-mix-rows { max-width: 480px; margin-left: auto; margin-right: auto; width: 100%; }

/* ── Celebrities: "Try it with a star" ── */
.celeb-block { margin: 22px 0 8px; }
.celeb-heading { margin: 0 0 2px; font-size: 16px; font-weight: 600; color: var(--gold); }
.celeb-sub { margin: 0 0 10px; font-size: 13px; line-height: 1.4; color: var(--m5); }
.celeb-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.celeb-row { scrollbar-width: none; }
.celeb-row::-webkit-scrollbar { display: none; }
.celeb-item, .celeb-credits-link { flex: 0 0 auto; scroll-snap-align: start; }
.celeb-item { width: 88px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 2px; background: none; border: 0; color: inherit; font: inherit; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.celeb-item:focus-visible, .celeb-credits-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 12px; }
.celeb-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; background: rgba(255, 255, 255, 0.06); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.celeb-initials { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 600; }
.celeb-name { max-width: 100%; font-size: 12px; line-height: 1.3; overflow-wrap: normal; word-break: normal; hyphens: none; }
.celeb-hu { display: inline-block; font-size: 10px; line-height: 1.25; color: var(--m5); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 1px 6px; }
.celeb-credits-link { align-self: center; width: 84px; padding: 8px 4px; background: none; border: 0; color: var(--m5); font: inherit; font-size: 12px; line-height: 1.3; text-align: center; text-decoration: underline; cursor: pointer; }
.celeb-confirm { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.celeb-confirm .celeb-photo { width: 72px; height: 72px; font-size: 24px; }
.celeb-confirm .btn-full { width: 100%; justify-content: center; text-align: center; }
.celeb-credits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.celeb-credits li { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.4; }
.celeb-credit-name { font-weight: 600; font-size: 14px; }
.celeb-credits a { color: var(--gold); }
.celeb-disclaimer { margin: 14px 0 4px; text-align: center; font-size: 12px; }

/* Compress My People rows on mobile: drop the archetype/description line entirely (name,
   type chip and the "Linked · live chart" lockup are enough to scan a long list). */
@media (max-width: 767px) {
  .rel-row { padding: 10px 12px; gap: 10px; }
  .rel-row-main { gap: 2px; }
  .rel-row-line { display: none; }
  .rel-avatar { flex-basis: 36px; width: 36px; height: 36px; font-size: 14px; }
}

/* ── Compatibility page, 2026-09-25: one number first, more graphic sections ── */
.rel-band-high { color: var(--gold); stroke: var(--gold); background: var(--gold); }
.rel-band-good { color: #4ade80; stroke: #22c55e; background: #22c55e; }
.rel-band-mid { color: #fbbf24; stroke: #f59e0b; background: #f59e0b; }
.rel-band-low { color: #f87171; stroke: #ef4444; background: #ef4444; }
.rel-score-lead { display: flex; align-items: center; gap: 18px; padding: 4px 0 6px; }
.rel-score-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.rel-ring { width: 118px; height: 118px; }
.rel-ring-track { stroke: var(--w08); }
.rel-ring-val { background: none; transition: stroke-dasharray 0.6s ease; }
.rel-ring-num { font-size: 34px; font-weight: 800; fill: var(--text); font-variant-numeric: tabular-nums; }
.rel-ring-band { background: none !important; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.rel-cols { flex: 1; display: flex; justify-content: space-around; align-items: flex-end; gap: 10px; height: 118px; }
.rel-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; flex: 1; min-width: 0; }
.rel-col-val { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rel-col-track { flex: 1; width: 22px; border-radius: 6px; background: var(--w08); display: flex; align-items: flex-end; overflow: hidden; }
.rel-col-fill { width: 100%; border-radius: 6px; }
.rel-col-label { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }
.rel-score-top { justify-content: flex-start; align-items: center; }
.rel-score-val { font-size: 28px; font-weight: 800; min-width: 44px; background: none !important; }
@media (max-width: 380px) { .rel-ring { width: 100px; height: 100px; } .rel-cols { height: 100px; } }

/* Element mix: what it means */
.rel-mix-insights { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rel-mix-insights li { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--m85, var(--text)); }
.rel-mix-ico { flex: 0 0 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.rel-mix-fill .rel-mix-ico { background: rgba(34,197,94,0.18); color: #4ade80; }
.rel-mix-same .rel-mix-ico { background: var(--gold-dim); color: var(--gold); }
.rel-mix-gap .rel-mix-ico { background: rgba(239,68,68,0.15); color: #f87171; }
.rel-mix-why { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--w05); font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.rel-mix-why b { color: var(--text); margin-right: 4px; }

/* Points of tension */
.rel-tension-strip { display: flex; gap: 4px; height: 8px; }
.rel-tension-seg { flex: 1; border-radius: 4px; padding: 0 !important; border: 0 !important; }
.rel-tension-seg.rel-intensity-high { background: #ef4444; }
.rel-tension-seg.rel-intensity-mid { background: #f59e0b; }
.rel-tension-seg.rel-intensity-low { background: #64748b; }
.rel-tension-sum { font-size: 12.5px; color: var(--muted); margin: -2px 0 2px; }
.rel-tension-sum .t-high { color: #f87171; } .rel-tension-sum .t-mid { color: #fbbf24; } .rel-tension-sum .t-low { color: var(--muted); }
.rel-friction-ico { flex: 0 0 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--w07); color: var(--gold); }
.rel-friction-card[data-kind="clash"] .rel-friction-ico { background: rgba(239,68,68,0.15); color: #f87171; }
.rel-friction-card[data-kind="pace"] .rel-friction-ico { background: rgba(59,130,246,0.15); color: #7fb0ff; }
.rel-friction-card[data-kind="gap"] .rel-friction-ico { background: var(--w08); color: #cbd5e1; }
.rel-friction-card[data-kind="excess"] .rel-friction-ico { background: rgba(245,158,11,0.15); color: #fbbf24; }
.rel-friction-card summary { align-items: center; }
.rel-friction-head { flex: 1; }
.rel-friction-meta { flex-direction: column; align-items: flex-end; gap: 5px; }
.rel-meter { display: flex; gap: 3px; }
.rel-meter i { width: 12px; height: 5px; border-radius: 3px; background: var(--w12); }
.rel-friction-card[data-kind] .rel-meter i.on { background: #f59e0b; }
.rel-friction-card:has(.rel-intensity-high) .rel-meter i.on { background: #ef4444; }
.rel-friction-card:has(.rel-intensity-low) .rel-meter i.on { background: #94a3b8; }
.rel-vs { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0 6px; }
.rel-vs-side { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.rel-vs-who { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rel-vs-char { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; background: var(--w07); border: 1px solid var(--border); color: var(--text); }
.rel-vs-link { font-size: 20px; color: var(--gold); }
.rel-vs-clash { color: #f87171; }
.rel-vs-pace { color: #7fb0ff; }

/* How to get along */
.rel-swap-flow { display: flex; align-items: center; justify-content: space-between; margin: 0 0 2px; }
.rel-swap-flow-line { flex: 1; height: 2px; margin: 0 8px; background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-dim)); border-radius: 2px; }
.rel-swap-face { position: relative; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--w12); color: var(--text); }
.rel-swap-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rel-swap-label { display: flex; align-items: center; gap: 6px; }
.rel-swap-need { border: 1px dashed rgba(244,114,182,0.45); background: rgba(244,114,182,0.06); }
.rel-swap-need .rel-swap-label { color: #f9a8d4; }
.rel-swap-arrow svg { display: block; }
.rel-vs-name { font-size: 11px; color: var(--muted); }
.rel-vs-char { font-size: 22px; line-height: 1; }
.rel-bar-fill.rel-band-high { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.rel-bar-fill.rel-band-good { background: linear-gradient(90deg, rgba(34,197,94,0.35), #22c55e); }
.rel-bar-fill.rel-band-mid { background: linear-gradient(90deg, rgba(245,158,11,0.35), #f59e0b); }
.rel-bar-fill.rel-band-low { background: linear-gradient(90deg, rgba(239,68,68,0.35), #ef4444); }
.rel-ring-num { font-size: 36px; }
.rel-band-legend { list-style: none; margin: 2px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.rel-band-legend li { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border-radius: 8px; border: 1px solid transparent; text-align: center; opacity: 0.6; }
.rel-band-legend li.is-on { opacity: 1; border-color: var(--border); background: var(--w05); }
.rel-band-dot { width: 22px; height: 5px; border-radius: 3px; }
.rel-band-name { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.2; }
.rel-band-range { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Compact band legend: one bar at the bands' real widths, labels under their segments,
   a pin at the pair's score */
.rel-bandbar { margin: 2px 0 8px; }
.rel-bandbar-track { position: relative; display: flex; gap: 2px; height: 8px; }
.rel-bandbar-seg { border-radius: 4px; opacity: 0.35; }
.rel-bandbar-seg.is-on { opacity: 1; }
.rel-bandbar-pin { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,0.55); }
.rel-bandbar-labels { display: flex; gap: 2px; margin-top: 6px; }
.rel-bandbar-label { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 10.5px; font-weight: 600; line-height: 1.2; color: var(--muted); }
.rel-bandbar-label small { font-size: 9.5px; font-weight: 400; opacity: 0.8; font-variant-numeric: tabular-nums; }
.rel-bandbar-label.is-on { color: var(--text); }

/* How to work with …: icon cards */
.rel-work-item { flex-direction: row; gap: 12px; align-items: flex-start; border-top: 0; padding: 12px; border-radius: 12px; background: var(--w05); border: 1px solid var(--border); }
.rel-work-item:first-of-type { padding-top: 12px; }
.rel-work-ico { flex: 0 0 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.rel-work-pitch .rel-work-ico { background: rgba(34,197,94,0.15); color: #4ade80; }
.rel-work-triggers .rel-work-ico { background: rgba(239,68,68,0.15); color: #f87171; }
.rel-work-decide .rel-work-ico { background: rgba(59,130,246,0.15); color: #7fb0ff; }
.rel-work-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rel-work-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Just for fun */
.rel-fun-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rel-fun-tile { padding: 12px; border-radius: 12px; background: var(--w05); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.rel-fun-ico { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.rel-fun-place .rel-fun-ico { background: rgba(236,72,153,0.16); color: #f9a8d4; }
.rel-fun-food .rel-fun-ico { background: rgba(245,158,11,0.16); color: #fbbf24; }
.rel-fun-watch .rel-fun-ico { background: rgba(59,130,246,0.16); color: #7fb0ff; }
.rel-fun-doIt .rel-fun-ico { background: rgba(34,197,94,0.16); color: #4ade80; }
.rel-fun-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rel-fun-text { font-size: 13.5px; line-height: 1.4; color: var(--text); font-weight: 500; }
.rel-fun-why { font-size: 11px; color: var(--m5, var(--muted)); margin-top: auto; }
@media (max-width: 340px) { .rel-fun-grid { grid-template-columns: 1fr; } }
.rel-fun-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.rel-work-item p.rel-work-label { font-size: 11px; line-height: 1.3; color: var(--muted); }

/* ── Best days together: uses the Power Days calendar styles (cal-*, pick-*, pd-split in
   style.css); only the pair-specific bits are here. ── */
.rel-days.power-days-card { gap: 12px; }
.rel-days-writing { color: var(--gold); }
.rel-days-skip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; font: inherit; font-size: 13px;
  color: var(--text); text-align: left; background: var(--w05); border: 1px solid rgba(239,68,68,0.3); cursor: pointer; }
.rel-days-both { font-size: 12.5px; color: var(--muted); margin: 4px 0 2px; }
.rel-days-both b { color: var(--text); }
.rel-days-why, .rel-days-idea { font-size: 13.5px; line-height: 1.5; color: var(--m85, var(--text)); margin: 4px 0; }
.rel-days-idea b { color: var(--gold); margin-right: 4px; }
.rel-days-upsell { padding: 10px 12px; border-radius: 10px; background: var(--gold-dim); font-size: 12.5px; color: var(--text); }

/* Person page chip bar: only while a person is open, in place of the People chips */
#toc-person { display: none; }
#results.rel-detail-open #toc-person { display: block; }
.rel-anchor { scroll-margin-top: 12px; }

/* Share sheet: the vertical story card itself as the preview */
.rel-share-story { display: flex; justify-content: center; margin: 4px 0 10px; }
.rel-share-story img, .rel-share-story .skel-story { width: min(58vw, 240px); aspect-ratio: 9 / 16; height: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--w04); display: block; box-shadow: 0 16px 40px rgba(0,0,0,0.5); }
#rel-share-kit { margin: 6px 0 4px; }
