/* Compatibility desk (js/compat/compat-desk.js): the Compatibility tab, and later the guest Match Check page.
   Setup card (type, partner), then the summary card and one collapsible section per part of the match. Layout follows
   the desk's own width (container queries), so it fits the reading tab or a landing page column alike. */

.compat-desk { container: compat / inline-size; display: grid; gap: 12px; }
.compat-desk .transits-heading { margin-bottom: 0; }
.compat-desk .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tab label: "Compatibility" is too long for six tabs on a phone, so it reads "Match" there. */
.summary-tab-short { display: none; }
@media (max-width: 780px) {
  .summary-tab-long { display: none; }
  .summary-tab-short { display: inline; }
}

/* 1. Setup ----------------------------------------------------------------------------------------------------------- */
/* overflow visible: surface cards clip, and the place suggestions must be able to drop below the card. */
.compat-setup { display: grid; gap: 14px; padding: 16px 18px; border-radius: 15px; overflow: visible; }
.compat-setup-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.compat-setup-row .transit-filter-label { min-width: 150px; }
.compat-subject-name { color: var(--ink); }
.compat-birth-panel, .compat-birth { display: grid; gap: 10px; }
.compat-birth-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compat-birth-row:first-child { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@container compat (max-width: 520px) {
  .compat-birth-row, .compat-birth-row:first-child { grid-template-columns: minmax(0, 1fr); }
}
.compat-field { position: relative; display: grid; gap: 4px; min-width: 0; }
.compat-field > span,
.compat-field > label > span { color: var(--gold-label, #8b867c); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.compat-field input,
.compat-field select {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--gold-border, #e8e2d7);
  border-radius: 10px;
  background: #fffefa;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}
.compat-field input:focus-visible,
.compat-field select:focus-visible { outline: 2px solid #b39a30; outline-offset: 1px; }
/* Suggestions (js/ui/autocomplete.js): a floating list under the input, the same look as the app's chart search.
   Styled here in full, because the landing pages don't load css/chart-controls.css. */
.compat-field.autocomplete { position: relative; }
.compat-field .autocomplete-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--gold-border-strong, #d9c27a);
  border-radius: 13px;
  background: var(--white, #fffefa);
  box-shadow: 0 18px 40px -8px rgb(37 37 35 / 26%);
}
.compat-field .autocomplete-list[hidden] { display: none; }
.compat-field .autocomplete-option {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}
.compat-field .autocomplete-option:hover,
.compat-field .autocomplete-option[aria-selected="true"] { background: var(--gold-100, #fbf3d6); }
.compat-field-status { min-height: 0; color: #8b867c; font-size: 10px; }
.compat-field-status:empty { display: none; }
.compat-saved { max-width: 420px; }
.compat-privacy { margin: 0; color: #8b867c; font-size: 10.5px; line-height: 1.5; }
.compat-error { margin: 0; color: #a2453f; font-size: 12px; font-weight: 650; }
.compat-error:empty { display: none; }
.compat-actions { display: flex; justify-content: flex-start; }
.compat-go {
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid var(--yellow-deep);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}
.compat-go:hover:not(:disabled) { background: var(--yellow-deep); }
.compat-go:focus-visible { outline: 2px solid #b39a30; outline-offset: 2px; }
.compat-go:disabled { cursor: not-allowed; opacity: .55; }

/* 2. Results ---------------------------------------------------------------------------------------------------------- */
.compat-results { display: grid; gap: 10px; }
.compat-results:empty { display: none; }
.compat-loading { margin: 0; color: #8b867c; font-size: 12px; }

.compat-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 18px; padding: 18px; border-radius: 15px; }
.compat-summary > .compat-flags,
.compat-summary > .compat-notes,
.compat-summary > .compat-footnote { grid-column: 1 / -1; }
@container compat (max-width: 560px) { .compat-summary { grid-template-columns: minmax(0, 1fr); } }
.compat-pair { display: flex; align-items: center; gap: 12px; min-width: 0; }
.compat-person { display: grid; flex: 1 1 0; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--gold-line); border-radius: 12px; background: var(--surface-paper-bg, #fffdf7); }
.compat-person strong { overflow: hidden; font-size: 14px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.compat-person small { color: #77736b; font-size: 10.5px; }
.compat-pair-link { width: 34px; height: 34px; flex: 0 0 34px; font-size: 16px; }

.compat-scores { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
@container compat (max-width: 560px) { .compat-scores { justify-content: stretch; } .compat-scores > .compat-score { flex: 1 1 0; } }
.compat-score { display: grid; justify-items: center; gap: 2px; min-width: 150px; padding: 12px 18px; border: 1px solid var(--gold-border); border-radius: 14px; background: #fffefa; text-align: center; }
.compat-score-label { color: var(--gold-label, #8b867c); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.compat-score strong { font-size: 30px; letter-spacing: -.04em; line-height: 1.1; }
.compat-score strong small { color: #8b867c; font-size: 14px; font-weight: 700; }
.compat-score-band { font-size: 11.5px; font-weight: 800; }
.compat-score.is-excellent .compat-score-band, .compat-score.is-good .compat-score-band { color: #3f7a4f; }
.compat-score.is-average .compat-score-band { color: #94741c; }
.compat-score.is-weak .compat-score-band { color: #a2453f; }

.compat-flags, .compat-notes, .compat-coming, .compat-manglik { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.compat-flag { display: flex; align-items: baseline; gap: 8px; padding: 8px 11px; border-radius: 10px; font-size: 12px; line-height: 1.45; }
.compat-flag-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; transform: translateY(-1px); }
.compat-flag.is-red { background: #fbeceb; color: #7d302b; }
.compat-flag.is-red .compat-flag-dot { background: #c9544c; }
.compat-flag.is-amber { background: #fdf4dc; color: #6f5714; }
.compat-flag.is-amber .compat-flag-dot { background: var(--yellow-deep); }
.compat-flag.is-info { background: #eef4ef; color: #355c40; }
.compat-flag.is-info .compat-flag-dot { background: var(--green); }
.compat-notes li { color: #77736b; font-size: 11px; line-height: 1.5; }
.compat-notes li::before { content: "ⓘ "; color: var(--gold-ink, #94741c); }
.compat-footnote { margin: 0; padding-top: 10px; border-top: 1px solid var(--gold-line); color: #8b867c; font-size: 10.5px; }

.compat-section-body { display: grid; gap: 12px; }
.compat-intro { margin: 0; color: #77736b; font-size: 11px; line-height: 1.55; }
.compat-table-wrap { overflow-x: auto; }
.compat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.compat-table th, .compat-table td { padding: 8px 10px; border-bottom: 1px solid var(--gold-line); text-align: left; vertical-align: top; }
.compat-table thead th { color: var(--gold-label, #8b867c); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.compat-table tbody th strong { font-size: 12.5px; }
.compat-table tfoot th, .compat-table tfoot td { border-bottom: 0; font-weight: 800; }
.compat-table tr.has-dosha { background: #fdf6f5; }
.compat-points { min-width: 86px; white-space: nowrap; }
.compat-points > span { display: block; font-weight: 750; }
.compat-bar { display: block; width: 70px; height: 5px; margin-top: 4px; overflow: hidden; border-radius: 3px; background: #efe9dc; }
.compat-bar i { display: block; height: 100%; border-radius: 3px; background: var(--yellow-deep); }
.compat-meaning { min-width: 200px; color: #4d4a43; line-height: 1.45; }
.compat-meaning small { display: block; margin-top: 3px; color: #355c40; font-size: 10.5px; }
.compat-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.compat-badge.is-dosha { background: #f6d9d6; color: #7d302b; }
.compat-badge.is-cancelled { background: #dcebdf; color: #355c40; }

.compat-manglik-row { display: grid; grid-template-columns: minmax(0, 160px) auto minmax(0, 1fr); align-items: center; gap: 4px 12px; padding: 9px 12px; border: 1px solid var(--gold-line); border-radius: 12px; font-size: 12px; }
.compat-manglik-row small { color: #77736b; font-size: 11px; }
@container compat (max-width: 520px) { .compat-manglik-row { grid-template-columns: minmax(0, 1fr) auto; } .compat-manglik-row small { grid-column: 1 / -1; } }
.compat-pill { justify-self: start; padding: 2px 9px; border-radius: 999px; background: #eef4ef; color: #355c40; font-size: 10px; font-weight: 800; }
.compat-manglik-row.is-high .compat-pill { background: #f6d9d6; color: #7d302b; }
.compat-manglik-row.is-mild .compat-pill { background: #fdf0cc; color: #6f5714; }

/* Verdict banner (top of the summary card), coloured by band. */
.compat-summary > .compat-verdict { grid-column: 1 / -1; }
.compat-verdict { display: grid; gap: 6px; padding: 14px 16px; border-radius: 13px; background: #252523; color: var(--white, #fffefa); }
.compat-verdict-main { display: grid; gap: 2px; }
.compat-verdict .compat-score-label { color: var(--yellow); }
.compat-verdict strong { font-size: 26px; letter-spacing: -.035em; line-height: 1.1; }
.compat-verdict small { color: rgb(255 254 250 / 72%); font-size: 11px; }
.compat-verdict-why { margin: 0; color: rgb(255 254 250 / 85%); font-size: 11.5px; line-height: 1.5; }
.compat-verdict.is-strong strong { color: #9fd3aa; }
.compat-verdict.is-goWithCare strong { color: var(--yellow); }
.compat-verdict.is-thinkItOver strong { color: #f2b56b; }
.compat-verdict.is-notRecommended strong { color: #f19a92; }

/* Partnership strength: one card per person (reuses the direction card look). */
.compat-netting { margin: 0; color: #4d4a43; font-size: 11.5px; line-height: 1.5; }
.compat-netting.is-eased { padding: 6px 9px; border-radius: 8px; background: #fdf4dc; }
.compat-list-title { margin: 4px 0 0; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.compat-list-title.is-strain { color: #a2453f; }
.compat-list-title.is-support { color: #3f7a4f; }
.compat-ref { padding: 0 6px; border-radius: 999px; background: #efe9dc; color: #77736b; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.compat-empty { margin: 0; color: #8b867c; font-size: 11px; }

/* Dasha watch: a lane per person (bars placed by date), a "Both" lane for joint periods, a date axis. */
.compat-timeline { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--gold-line); border-radius: 14px; background: #fffefa; }
.compat-lane { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 10px; }
.compat-lane-name { overflow: hidden; font-size: 11.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.compat-lane-track { position: relative; height: 26px; border-radius: 7px; background: #f4efe2; }
.compat-lane--axis .compat-lane-track { height: 16px; background: none; }
.compat-lane--joint .compat-lane-track { height: 14px; }
.compat-lane-bar { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-right: 2px solid #fffefa; border-radius: 6px; font-size: 9.5px; font-weight: 800; white-space: nowrap; }
.compat-lane-bar.is-caution { background: #e8a29c; color: #5e211c; }
.compat-lane-bar.is-support { background: #a9d3b2; color: #234a2d; }
.compat-lane-bar.is-quiet { background: #e4ddcd; color: #77736b; }
.compat-lane-bar.is-joint-stress { background: repeating-linear-gradient(45deg, #c9544c 0 6px, #e8a29c 6px 12px); }
.compat-lane-bar.is-joint-support { background: repeating-linear-gradient(45deg, #6c9b78 0 6px, #a9d3b2 6px 12px); }
.compat-lane-missing { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 8px; color: #8b867c; font-size: 10.5px; }
.compat-tick { position: absolute; top: 0; color: #8b867c; font-size: 9.5px; transform: translateX(-50%); white-space: nowrap; }
.compat-tick:first-child { transform: none; }
.compat-tick:last-child { transform: translateX(-100%); }
@container compat (max-width: 520px) { .compat-lane { grid-template-columns: 60px minmax(0, 1fr); } .compat-lane-bar > span { display: none; } }
.compat-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; color: #66625a; font-size: 10.5px; }
.compat-legend li::before { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; content: ""; vertical-align: -1px; }
.compat-legend .is-caution::before { background: #e8a29c; }
.compat-legend .is-support::before { background: #a9d3b2; }
.compat-legend .is-quiet::before { background: #e4ddcd; }
.compat-legend .is-joint::before { background: repeating-linear-gradient(45deg, #c9544c 0 3px, #e8a29c 3px 6px); }

/* AI write-up */
.compat-writeup { display: grid; gap: 8px; }
.compat-writeup p { margin: 0; color: #3d3a34; font-size: 13px; line-height: 1.6; }
.compat-writeup-summary { font-size: 14px !important; }
.compat-writeup-list { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: #3d3a34; font-size: 12.5px; line-height: 1.55; }

/* Saved matches of the open chart: one chip per match, coloured by verdict; x deletes. */
.compat-saved-matches { display: grid; gap: 8px; }
.compat-saved-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.compat-saved-chip { display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--gold-border, #eadfc4); border-left-width: 4px; border-radius: 11px; background: #fffefa; }
.compat-saved-chip.is-strong, .compat-saved-chip.is-goWithCare { border-left-color: var(--green); }
.compat-saved-chip.is-thinkItOver { border-left-color: var(--yellow-deep); }
.compat-saved-chip.is-notRecommended { border-left-color: #c9544c; }
.compat-saved-open { display: grid; gap: 1px; padding: 6px 10px; border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.compat-saved-open strong { font-size: 12.5px; }
.compat-saved-open small { color: #77736b; font-size: 10.5px; }
.compat-saved-open:hover { background: var(--gold-100, #fbf3d6); }
.compat-saved-delete { padding: 0 10px; border: 0; border-left: 1px solid var(--gold-line); background: none; color: #8b867c; cursor: pointer; font-size: 16px; }
.compat-saved-delete:hover { background: #fbeceb; color: #a2453f; }
.compat-saved-open:focus-visible, .compat-saved-delete:focus-visible { outline: 2px solid #b39a30; outline-offset: -2px; }

/* How your charts meet: one card per direction, a row per rule (label, points, the reason). */
.compat-directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container compat (max-width: 760px) { .compat-directions { grid-template-columns: minmax(0, 1fr); } }
.compat-direction { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--gold-line); border-radius: 14px; background: #fffefa; }
.compat-direction-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--gold-line); }
.compat-direction-title { display: grid; gap: 1px; min-width: 0; }
.compat-direction-title small { color: #8b867c; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.compat-direction-title strong { overflow: hidden; font-size: 14px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.compat-direction-score { font-size: 22px; font-weight: 800; letter-spacing: -.04em; white-space: nowrap; }
.compat-direction-score small { color: #8b867c; font-size: 11px; font-weight: 700; }
.compat-rules { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.compat-rule { display: grid; gap: 2px; padding: 7px 9px; border-left: 3px solid #e4ddcd; border-radius: 0 9px 9px 0; background: #fbf8f1; }
.compat-rule.is-good { border-left-color: var(--green); background: #f1f7f2; }
.compat-rule.is-bad { border-left-color: #c9544c; background: #fcf1f0; }
.compat-rule.is-locked, .compat-rule.is-skipped { border-left-style: dashed; opacity: .85; }
.compat-rule-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.compat-rule-head strong { font-size: 12px; }
.compat-rule small { color: #66625a; font-size: 11px; line-height: 1.45; }
.compat-rule-points { flex: 0 0 auto; font-size: 12px; font-weight: 800; }
.compat-rule.is-good .compat-rule-points { color: #3f7a4f; }
.compat-rule.is-bad .compat-rule-points { color: #a2453f; }
.compat-lock { flex: 0 0 auto; padding: 1px 8px; border: 1px solid var(--yellow-deep); border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 10px; font-weight: 800; text-decoration: none; }
.compat-lock:hover { background: var(--yellow-deep); }
.compat-callout { margin: 0; padding: 9px 12px; border-radius: 10px; background: #f4efe2; color: #4d4a43; font-size: 12px; line-height: 1.5; }
.compat-callout.is-locked { background: #fdf6dc; }
.compat-callout a { color: var(--gold-ink, #7a6726); font-weight: 800; }

/* 3. Match Check landing page (landing/match-check.html) -------------------------------------------------------------- */
.compat-hero-list { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.compat-hero-list li { display: grid; gap: 2px; }
.compat-hero-list strong { font-size: 13px; }
.compat-hero-list span { opacity: .8; font-size: 12px; line-height: 1.45; }
.compat-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@container compat (max-width: 760px) { .compat-two { grid-template-columns: minmax(0, 1fr); } }
/* A person's card: gold header bar (like the reading's section bars), fields below. */
.compat-person-form { display: grid; align-content: start; min-width: 0; overflow: visible; border: 1px solid var(--gold-border, #eadfc4); border-radius: 15px; background: #fffefa; box-shadow: 0 10px 26px -18px rgb(44 39 28 / 35%); }
.compat-person-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px 14px 0 0; }
.compat-person-head .surface-coin { width: 30px; height: 30px; flex: 0 0 30px; font-size: 14px; }
.compat-person-title { display: grid; gap: 1px; min-width: 0; }
.compat-person-title h3 { margin: 0; font-size: 14.5px; letter-spacing: -.02em; }
.compat-person-title small { color: #8b867c; font-size: 10.5px; }
.compat-person-body { display: grid; gap: 10px; padding: 14px; }
.compat-person-body .compat-birth-row { grid-template-columns: minmax(0, 1fr); }
.compat-person-body .compat-birth-row:nth-child(2) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compat-person-body .compat-birth-row:first-child { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.compat-person-body .compat-birth-row--three,
.compat-person-body .compat-birth-row--three:first-child { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 110px); }
@container compat (max-width: 420px) {
  .compat-person-body .compat-birth-row--three,
  .compat-person-body .compat-birth-row--three:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.compat-saved-guest { display: grid; gap: 8px; }
.compat-match:focus, #match:focus { outline: none; }
.compat-saved-note { margin: 0; color: #355c40; font-size: 11.5px; }
.compat-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding: 18px; border-radius: 15px; }
.compat-next > div:first-child { flex: 1 1 340px; }
.compat-next h3 { margin: 2px 0 6px; font-size: 17px; }
.compat-next p { margin: 0; color: #4d4a43; font-size: 12.5px; line-height: 1.55; }
.compat-next-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.compat-faq { display: grid; gap: 8px; }
.compat-faq-item { padding: 12px 16px; border-radius: 12px; }
.compat-faq-item summary { cursor: pointer; font-size: 13.5px; font-weight: 800; }
.compat-faq-item p { margin: 8px 0 0; color: #4d4a43; font-size: 12.5px; line-height: 1.6; }
.compat-koota-card p { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }

.compat-coming li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px dashed var(--gold-border); border-radius: 12px; opacity: .85; }
.compat-coming .surface-coin { width: 28px; height: 28px; flex: 0 0 28px; font-size: 13px; }
.compat-coming li > span:last-child { display: grid; gap: 1px; }
.compat-coming strong { font-size: 12.5px; }
.compat-coming small { color: #8b867c; font-size: 10.5px; }
