:root {
  color-scheme: dark;
  font: 100%/1.5 system-ui, sans-serif;
  color: #fcf7ff;
  background: #090812;
  --subtle: #cec0df;
  --accent: #e5c4ff;
  --line: #59466f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 12px 17px, #e4d0ffba 0 1px, transparent 1.5px) 0 0 / 91px 83px,
    radial-gradient(circle at 39px 49px, #a89ad975 0 1px, transparent 1.4px) 0 0 / 137px 119px,
    radial-gradient(circle at 21px 30px, #e5ccff80 0 1px, transparent 2px) 0 0 / 201px 173px,
    radial-gradient(ellipse at 85% 9%, #241839 0%, transparent 45rem),
    radial-gradient(ellipse at 8% 64%, #15162a 0%, transparent 35rem), #090812;
}
.shell { width: min(100% - 1.5rem, 36rem); margin-inline: auto; }
.site-header { padding-block: .9rem .65rem; }
.brand { color: inherit; text-decoration: none; font-size: 1.35rem; font-weight: 740; display: inline-block; }
.brand span, em { color: var(--accent); }
main { padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
.intro { margin: .4rem 0 1rem; }
h1 { font: 500 clamp(1.85rem, 8vw, 3.65rem)/1.02 Georgia, serif; letter-spacing: -.035em; }
.intro h1 em { display: block; }
.intro p, .pair-names, .summary-text, .area-copy, .detail p, dialog p { color: var(--subtle); }
.intro p { margin-top: .5rem; max-width: 29rem; }
.panel { border: 1px solid var(--line); border-radius: 1.15rem; background: #171322; padding: 1rem; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; list-style: none; margin: 0 0 .85rem; padding: 0; }
.steps li { color: var(--subtle); font-size: 1rem; border-top: .2rem solid var(--line); padding-top: .3rem; }
.steps [aria-current], .steps [data-complete] { border-color: var(--accent); }
.steps [aria-current] { color: #fcf7ff; font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
#form-title { font-size: 1.25rem; font-weight: 700; margin-bottom: .65rem; }
#person-fields > label { display: block; margin-bottom: .25rem; }
input, select, button { font: inherit; min-height: 2.75rem; border-radius: .55rem; }
input, select { width: 100%; padding: .4rem .55rem; color: inherit; background: #2d2240; border: 1px solid #755d91; }
#person-fields > input, #person-fields > select { margin-bottom: .65rem; }
.birthday legend { margin-bottom: .25rem; }
:focus-visible { outline: 2px solid #ffdb9b; outline-offset: 3px; }
.actions { display: flex; gap: .45rem; margin-top: .9rem; }
button { padding: .45rem .7rem; border: 1px solid transparent; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .7; cursor: wait; }
.primary { flex: 1; color: #21142f; background: var(--accent); }
.status:not(:empty) { margin-top: .6rem; color: #ffd2a0; }
.result-title { font-size: clamp(1.65rem, 6vw, 2.45rem); }
.pair-names { margin-top: .25rem; overflow-wrap: anywhere; }
.strong { --signal: #97e6c3; }
.mixed { --signal: #ffda97; }
.attention { --signal: #ffa8b5; }
.summary { display: flex; gap: .75rem; align-items: center; margin: .7rem 0; }
.score {
  flex: 0 0 4.2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(closest-side, #171322 83%, transparent 85%), conic-gradient(var(--signal) var(--score), #4f3c62 0);
  font-size: 1.2rem;
  font-weight: 780;
  color: var(--signal);
}
.areas { display: grid; gap: .4rem; }
.area { border-radius: .65rem; background: #211c31; padding: .45rem .6rem; }
.area-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; }
.area-heading h3 { font-size: 1rem; }
.area-number, .area-label { color: var(--signal); font-weight: 680; }
.area-label, .area-copy { font-size: 1rem; }
.area-label { cursor: pointer; }
.area-copy { margin-top: .25rem; }
meter { display: block; appearance: none; border: 0; width: 100%; height: .34rem; margin: .25rem 0 .32rem; color: var(--signal); }
meter::-webkit-meter-bar { background: #483655; border: 0; height: .34rem; }
meter::-webkit-meter-optimum-value { background: var(--signal); }
meter::-moz-meter-bar { background: var(--signal); }
.detail { margin-top: .55rem; }
.detail summary { cursor: pointer; font-weight: 650; }
.detail h3, .detail p { margin-top: .35rem; }
dialog { max-width: min(calc(100% - 1.5rem), 28rem); border: 1px solid var(--line); padding: 1.2rem; border-radius: 1rem; background: #1b1728; color: inherit; }
dialog::backdrop { background: #0f091be0; }
dialog p { margin: .5rem 0 1rem; }
dialog button { width: 100%; }
@media (min-width: 40rem) {
  .site-header { padding-block: 1.4rem 1rem; }
  .panel { padding: 1.35rem; }
  .areas { gap: .55rem; }
}

.site-header, .intro, .panel, dialog { text-align: center; }
.intro p { margin-inline: auto; text-wrap: balance; }
legend { margin-inline: auto; }
#form-title { font-size: 1.45rem; }
#name { text-align: center; font-size: 1.1rem; }
.gender { margin: .1rem 0 .7rem; }
.gender-options { display: flex; gap: .55rem; margin-top: .25rem; }
.gender-options label {
  flex: 1; min-height: 2.8rem; border: 1px solid var(--line); border-radius: .6rem;
  background: #201b2c; color: inherit; font-size: 1.05rem;
}
.gender-options label { display: flex; align-items: center; justify-content: center; gap: .45rem; cursor: pointer; }
.gender-options label:has(:checked) { border-color: #cfb2f2; background: #30243f; }
.gender-options input { width: 1.1rem; height: 1.1rem; min-height: 0; padding: 0; accent-color: var(--accent); }
.summary { justify-content: center; }
.summary-text { text-align: start; }
@media (max-height: 720px) and (max-width: 40rem) {
  .site-header { padding-block: .4rem; }
  .intro { margin: 0 0 .65rem; }
  .intro h1 em { display: inline; }
  .panel { padding: .8rem; }
}

.date-fields {
  display: grid;
  grid-template-columns: .85fr 1.35fr 1fr;
  gap: .4rem;
}
.date-fields select {
  min-width: 0;
  padding-inline: .35rem;
  background: #201b2c;
  border-color: var(--line);
}
.quiet-action {
  padding: 0 .3rem;
  border: 0;
  background: transparent;
  color: var(--subtle);
  font-size: .875rem;
  text-underline-offset: .2em;
}
.quiet-action:hover, .quiet-action:focus-visible { color: #fff; text-decoration: underline; }
.steps li { display: flex; justify-content: center; align-items: flex-start; }
.step-back { margin-top: -.35rem; }
.step-back span { margin-inline-end: .2rem; }
.restart { display: block; margin: .25rem auto -.35rem; }
.pair-illustration { display: block; width: min(100%, 12rem); height: auto; margin: 0 auto .45rem; }
.pair-illustration.reverse { transform: scaleX(-1); }
.result-title { color: var(--signal, inherit); text-wrap: balance; }
.summary-text { line-height: 1.35; max-width: 26ch; }
.app-invite {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem .7rem;
  align-items: start;
  margin-top: .85rem;
  padding: .75rem;
  text-align: start;
  border: 1px solid #785c99;
  border-radius: .85rem;
  background: radial-gradient(ellipse at 10% 0%, #50315e, transparent 75%), #2b1b42;
}
.app-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  aspect-ratio: 1;
  border-radius: .65rem;
  color: #f3d5ff;
  background: #664686;
  font-size: 1.35rem;
}
.app-invite h2 { font-size: 1.08rem; line-height: 1.2; text-wrap: balance; }
.app-invite p { margin-top: .25rem; font-size: .9rem; line-height: 1.35; color: #ecdef8; }
.app-invite button { grid-column: 1 / -1; width: 100%; }

.mode-switch {
  display: inline-flex;
  gap: .2rem;
  margin-top: .75rem;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #171322;
}
.mode-link { padding: .3rem .75rem; color: var(--subtle); text-decoration: none; border-radius: .45rem; }
.mode-link[aria-current] { color: #241734; background: var(--accent); font-weight: 650; }
.guide { margin: 2rem auto 0; max-width: 34rem; }
.guide h2, .guide h3 { margin: .9rem 0 .35rem; }
.guide p { margin-bottom: .5rem; color: var(--subtle); }
.example-result { border-left: 3px solid var(--accent); padding: .5rem .8rem; background: #211c31; border-radius: .35rem; }
.example-result .example-label { font-size: .9rem; }
.share-row { margin-top: .9rem; }
.share-button { width: 100%; background: #342748; border-color: #785c99; color: inherit; }
#share-status:empty { display: none; }
#share-status { margin-top: .25rem; color: var(--subtle); }
#share-dialog textarea { width: 100%; margin-bottom: .6rem; font: inherit; padding: .5rem; border-radius: .4rem; }
#app-download { display: block; margin-bottom: .55rem; padding: .65rem; border-radius: .55rem; font-weight: 700; text-decoration: none; }
.summary-text p + p { margin-top: .35rem; }
