:root {
  color-scheme: dark;
  --ink: #f8f1fa;
  --muted: #b7abc4;
  --line: #372b47;
  --violet: #b794e7;
  --rose: #ef91b1;
  --green: #98d7bb;
  --bg: #110b19;
  --panel: #1b1228;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(circle at 78% -10%, #44285c 0, transparent 34rem),
    linear-gradient(155deg, #171022, #0d0912 65%);
  color: var(--ink);
  font:
    16px/1.5 ui-rounded,
    "SF Pro Rounded",
    system-ui,
    sans-serif;
  min-height: 100vh;
}
.shell {
  width: min(680px, 100%);
  margin: auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px 34px;
}
.hero {
  padding: 20px 2px 18px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--violet);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}
.hero h1 {
  max-width: 470px;
  margin: 0;
  font:
    400 clamp(2rem, 8vw, 3.4rem) / 0.98 Georgia,
    serif;
  letter-spacing: -0.04em;
}
.connection {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.action,
.orb,
.primary,
.secondary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}
.orb {
  padding: 10px 15px;
  background: var(--ink);
  color: #29133e;
  font-weight: 750;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0c0812;
}
.tab {
  border: 0;
  border-radius: 12px;
  background: 0 0;
  color: var(--muted);
  padding: 9px 4px;
  font:
    600 0.78rem/1 ui-rounded,
    system-ui;
  cursor: pointer;
}
.tab.active {
  background: #312144;
  color: var(--ink);
}
.page {
  display: none;
  padding: 22px 0;
}
.page.active {
  display: block;
}
.moon-card,
.quiet-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 25px;
  background: linear-gradient(145deg, #2d1b42, #1b112a);
  box-shadow: 0 20px 55px #0004;
}
.moon-card {
  position: relative;
  overflow: hidden;
}
.moon-card:after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -80px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 38% 38%,
    #ffe6ec 0 3%,
    #efb4cc 4% 27%,
    #8962a1 28% 51%,
    #21152e 52%
  );
  opacity: 0.5;
}
.day {
  display: flex;
  align-items: baseline;
  gap: 11px;
  position: relative;
  z-index: 1;
}
.day span {
  font:
    400 5.5rem/0.9 Georgia,
    serif;
  letter-spacing: -0.09em;
}
.day small {
  color: var(--muted);
}
h2 {
  position: relative;
  z-index: 1;
  margin: 13px 0 7px;
  font:
    400 1.65rem/1.05 Georgia,
    serif;
}
.moon-card p,
.quiet-card p,
.section-head p {
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}
.metrics span {
  padding: 7px 10px;
  border: 1px solid #725785;
  border-radius: 99px;
  background: #170d23b8;
  color: #ded4e6;
  font-size: 0.82rem;
}
.metrics b {
  margin-left: 4px;
  color: #fff;
}
.quiet-card {
  margin-top: 14px;
  background: #171120;
}
.section-head {
  padding: 2px 1px 18px;
}
.section-head h2 {
  font-size: 2.05rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
label {
  display: grid;
  gap: 6px;
  color: #e8dff0;
  font-size: 0.86rem;
  font-weight: 650;
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #120c1b;
  color: var(--ink);
  font: inherit;
  padding: 12px;
}
small {
  font-weight: 400;
  color: var(--muted);
}
.wide {
  grid-column: 1/-1;
}
.primary,
.secondary {
  padding: 13px 17px;
  font-weight: 750;
}
.primary {
  background: linear-gradient(110deg, #e9afdb, #b895ed);
  color: #201124;
}
.secondary {
  background: #2b2139;
  color: var(--ink);
  border: 1px solid #59436c;
}
.two-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 18px;
}
.action {
  min-height: 104px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  background: #21142d;
  color: var(--ink);
}
.action b,
.action span {
  display: block;
}
.action b {
  font-size: 1rem;
}
.action span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}
.action.start {
  border-color: #8d5576;
  background: linear-gradient(145deg, #462136, #281326);
}
.action.stop {
  border-color: #4d806e;
  background: linear-gradient(145deg, #17352f, #14241f);
}
.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 18px;
}
.mood {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 94px;
  padding: 14px 6px 12px;
  background: #120c1b;
  color: var(--muted);
  font:
    650 0.8rem/1.2 ui-rounded,
    system-ui;
  cursor: pointer;
}
.mood span {
  display: block;
  margin-bottom: 7px;
  font-size: 2.6rem;
  line-height: 1;
}
.mood.active {
  border-color: var(--rose);
  background: #392037;
  color: var(--ink);
  box-shadow: 0 0 0 2px #ef91b122;
}
.consent-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}
.switch {
  display: flex;
  grid-template: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.switch span {
  position: relative;
  width: 54px;
  height: 31px;
  border-radius: 99px;
  background: #42354e;
  transition: 0.2s;
}
.switch span:after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #ddd4e4;
  transition: 0.2s;
}
.switch input:checked + span {
  background: #8c5cb7;
}
.switch input:checked + span:after {
  transform: translateX(23px);
  background: #fff;
}
.switch input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.switch b {
  font-size: 0.72rem;
}
.privacy-list {
  padding: 13px 15px;
  border-left: 3px solid var(--green);
  background: #10251f;
  border-radius: 4px 12px 12px 4px;
}
.export-status {
  font-weight: 700;
  color: var(--green) !important;
}
footer {
  padding: 0 20px max(26px, env(safe-area-inset-bottom));
  text-align: center;
  color: #8d7d9b;
  font-size: 0.76rem;
}
.reading-face {
  margin: 16px 0;
}
.reading-face select {
  margin-top: 7px;
}
.reflection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.reflection-rating {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  background: #21142d;
  color: var(--ink);
  font:
    700 0.82rem/1.2 ui-rounded,
    system-ui;
  cursor: pointer;
}
.reflection-rating:focus-visible,
.reflection-rating:hover:not(:disabled) {
  border-color: var(--rose);
  background: #392037;
}
.reflection-rating:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.resonance-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}
.resonance-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1c1227;
}
.resonance-row b {
  font-size: 0.78rem;
}
.resonance-row small {
  color: #a99bb2;
  font-size: 0.68rem;
}
.date-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.date-actions button {
  border-radius: 14px;
}
.relationship-card {
  margin-top: 18px;
  border: 1px solid #725785;
  border-radius: 30px;
  padding: 25px;
  background: radial-gradient(circle at 18% 18%, #513667 0, transparent 18rem),
    linear-gradient(145deg, #251632, #120c1a);
  box-shadow: 0 22px 60px #0005;
}
.relationship-main {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 18px;
}
.relationship-main > span {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #9da9bc;
  color: #14101c;
  font:
    400 3.5rem/1 Georgia,
    serif;
  box-shadow: inset 0 0 0 3px #ffffffa8;
}
#relationship-icon[data-tone="open"] {
  background: #ffcc58;
}
#relationship-icon[data-tone="easy"] {
  background: #a9d9ff;
}
#relationship-icon[data-tone="changeable"] {
  background: #9da9bc;
}
#relationship-icon[data-tone="tender"] {
  background: #5d91c9;
}
#relationship-icon[data-tone="intense"] {
  background: #9a72d6;
}
.relationship-main h2 {
  margin-top: 0;
}
.relationship-main p,
.relationship-names {
  color: var(--muted);
}
.relationship-arc {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}
.relationship-day {
  display: grid;
  place-items: center;
  min-height: 66px;
  border: 1px solid #ffffff24;
  border-radius: 16px;
  background: #21152e;
  text-align: center;
}
.relationship-day b {
  font:
    400 1.35rem/1 Georgia,
    serif;
}
.relationship-day small {
  font-size: 0.65rem;
}
.relationship-day.open {
  background: #5c4820;
}
.relationship-day.easy {
  background: #29435a;
}
.relationship-day.changeable {
  background: #373c4d;
}
.relationship-day.tender {
  background: #243d59;
}
.relationship-day.intense {
  background: #442e62;
}
.relationship-day.selected {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (max-width: 440px) {
  .form-grid,
  .two-actions {
    grid-template-columns: 1fr;
  }
  .day span {
    font-size: 4.5rem;
  }
  .tabs {
    grid-template-columns: repeat(3, 1fr);
  }
  .mood-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .consent-row {
    grid-template-columns: 1fr;
  }
  .relationship-main {
    grid-template-columns: 74px 1fr;
  }
  .relationship-main > span {
    width: 74px;
    height: 74px;
    font-size: 2.8rem;
  }
  .relationship-arc {
    gap: 5px;
  }
  .relationship-day {
    min-height: 58px;
    border-radius: 12px;
  }
}
