:root {
  --bg: #070918;
  --panel: rgba(13, 18, 38, 0.82);
  --panel-strong: rgba(16, 20, 45, 0.94);
  --surface: rgba(255, 255, 255, 0.07);
  --surface-2: rgba(255, 255, 255, 0.11);
  --ink: #fbfbf3;
  --muted: #c5c4d8;
  --soft: #8f91ad;
  --line: rgba(205, 219, 255, 0.17);
  --line-strong: rgba(255, 207, 154, 0.32);
  --purple: #7b61d8;
  --purple-2: #314a86;
  --lilac: #d9d7ff;
  --pink: #ff7aa8;
  --cyan: #7ad7e8;
  --green: #c9e78a;
  --amber: #ffc46f;
  --shadow: 0 28px 90px rgba(2, 4, 18, 0.62);
  --glow: 0 0 34px rgba(255, 196, 111, 0.22);
  --font-sans:
    "Space Grotesk", "Avenir Next", "Segoe UI", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, sans-serif;
  color-scheme: dark;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 50% 10%, rgba(217, 178, 255, 0.16), transparent 24%),
    radial-gradient(circle at 82% 0%, rgba(122, 97, 216, 0.14), transparent 26%),
    linear-gradient(140deg, rgba(19, 24, 52, 0.86), transparent 32%),
    linear-gradient(180deg, #04050c 0%, #080918 54%, #020207 100%);
  color: var(--ink);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 8%, rgba(219, 188, 255, 0.16), transparent 20%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.018));
  mix-blend-mode: screen;
  opacity: 0.58;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 78%);
}

button,
textarea,
input,
select {
  font: inherit;
  font-family: var(--font-sans);
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(350px, 430px);
  gap: 24px;
  padding: 22px;
  align-items: start;
  justify-content: center;
}

.context-panel,
.insight-panel {
  background: linear-gradient(180deg, rgba(18, 24, 52, 0.86), rgba(7, 9, 24, 0.76));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.context-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.intro-panel {
  --portal-o-breath-duration: 5.2s;
  --portal-o-halo-opacity: 0.5;
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  min-height: 100dvh;
  place-items: center;
  align-content: center;
  gap: 34px;
  padding: clamp(34px, 7vw, 72px) clamp(20px, 5vw, 54px);
  background:
    linear-gradient(180deg, rgba(2, 2, 8, 0.03), rgba(2, 2, 8, 0.12) 62%, rgba(2, 2, 8, 0.48)),
    url("../Images/portal-introduction-space-for-two.png") center 50% / contain no-repeat,
    #020208;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}


.intro-artwork-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(100vw, 46.258dvh);
  height: min(100dvh, 216.178vw);
  transform: translate(-50%, -50%);
  aspect-ratio: 853 / 1844;
}

.intro-portal-o {
  --portal-o-x: 50%;
  --portal-o-y: 50%;
  position: absolute;
  top: 44.85%;
  left: 28.9%;
  z-index: 1;
  width: 13.8%;
  min-width: 44px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  outline: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) translateZ(0);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  isolation: isolate;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.intro-portal-o::before,
.intro-portal-o::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.intro-portal-o::before {
  inset: -4%;
  z-index: -1;
  background: radial-gradient(
    circle,
    rgba(249, 239, 255, 0.1) 0 34%,
    rgba(200, 169, 226, 0.2) 46%,
    rgba(147, 103, 181, 0.1) 60%,
    transparent 76%
  );
  box-shadow:
    0 0 12px rgba(205, 175, 232, 0.22),
    0 0 28px rgba(146, 103, 177, 0.14);
  opacity: var(--portal-o-halo-opacity);
  transform: scale(0.97) translateZ(0);
  filter: brightness(1);
  animation: portalOBreathe var(--portal-o-breath-duration) cubic-bezier(0.45, 0, 0.3, 1) infinite;
  transition: filter 320ms ease;
}

.intro-portal-o::after {
  inset: 17%;
  background: radial-gradient(
    circle at var(--portal-o-x) var(--portal-o-y),
    rgba(255, 249, 238, 0.22),
    rgba(128, 82, 154, 0.12) 42%,
    transparent 70%
  );
  border: 1px solid rgba(245, 229, 255, 0.12);
  box-shadow:
    inset 0 0 7px rgba(255, 246, 232, 0.12),
    inset 0 0 13px rgba(93, 50, 116, 0.22);
  opacity: 0.52;
  transform: translate3d(-1.5%, 1%, 0);
  animation: portalOInnerDrift 7.4s ease-in-out infinite;
  transition: opacity 320ms ease, background-position 260ms ease;
}

.intro-portal-o:is(:hover, .portal-o-proximity)::before {
  filter: brightness(1.12);
}

.intro-portal-o:is(:hover, .portal-o-proximity)::after {
  opacity: 0.58;
}

.intro-portal-o:active {
  transform: translate(-50%, -50%) scale(0.975) translateZ(0);
}

.intro-portal-o:focus-visible {
  outline: 1px solid rgba(233, 214, 247, 0.68);
  outline-offset: 7px;
}

.intro-portal-o.portal-o-pulse::before {
  animation: portalOPressPulse 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.2)),
    linear-gradient(180deg, transparent 62%, rgba(2, 2, 8, 0.32));
  box-shadow:
    inset 0 0 120px rgba(255, 255, 255, 0.035),
    inset 0 -80px 120px rgba(0, 0, 0, 0.84);
}

.intro-panel::after {
  content: "";
  position: absolute;
  inset: auto 20% -30% 20%;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 178, 255, 0.14), rgba(123, 97, 216, 0.065) 46%, transparent 70%);
  filter: blur(34px);
  pointer-events: none;
  z-index: 1;
}

.context-panel,
.phone-stage,
.insight-panel {
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.insight-panel {
  display: none;
}

body.portal-intro-active .app-shell,
body.portal-intro-leaving .app-shell {
  min-height: 100svh;
  min-height: 100dvh;
  width: 100vw;
  height: 100svh;
  height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 0;
  background: #020208;
}

body.portal-intro-active,
body.portal-intro-leaving {
  overflow: hidden;
}

body.portal-intro-active .context-panel,
body.portal-intro-leaving .context-panel {
  grid-column: 1 / -1;
  width: 100vw;
  max-width: none;
  height: 100svh;
  height: 100dvh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  border-radius: 0;
  justify-self: center;
  align-self: center;
}

body.portal-intro-active .phone-stage,
body.portal-intro-active .insight-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
}

body.portal-app-ready .context-panel {
  display: none;
}

body.portal-intro-leaving .context-panel {
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
}

body.portal-intro-ready .phone-stage,
body.portal-intro-ready .insight-panel {
  opacity: 0;
  transform: translateY(14px);
  animation: panelReveal 520ms ease both;
}

body.portal-intro-ready .phone-stage,
body.portal-intro-ready .insight-panel {
  animation-delay: 80ms;
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes portalOBreathe {
  0%,
  100% {
    opacity: calc(var(--portal-o-halo-opacity) - 0.05);
    transform: scale(0.97) translateZ(0);
  }

  50% {
    opacity: calc(var(--portal-o-halo-opacity) + 0.04);
    transform: scale(1.035) translateZ(0);
  }
}

@keyframes portalOInnerDrift {
  0%,
  100% {
    transform: translate3d(-1.5%, 1%, 0);
  }

  50% {
    transform: translate3d(2%, -1.5%, 0);
  }
}

@keyframes portalOPressPulse {
  0% {
    opacity: var(--portal-o-halo-opacity);
    transform: scale(0.98) translateZ(0);
  }

  42% {
    opacity: 0.64;
    transform: scale(1.105) translateZ(0);
  }

  100% {
    opacity: var(--portal-o-halo-opacity);
    transform: scale(0.98) translateZ(0);
  }
}

.brand-lockup {
  display: grid;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.brand-lockup img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 54%;
  border-radius: 8px;
  border: 1px solid rgba(255, 207, 154, 0.28);
  box-shadow: 0 18px 54px rgba(255, 122, 168, 0.2);
}

.intro-mark {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: clamp(18px, 3vw, 28px);
  width: 100%;
  text-align: center;
  padding: 22px 0;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.portal-wordmark {
  width: min(700px, 94vw);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.1));
}

.portal-logo-line {
  fill: none;
  stroke: rgba(251, 251, 243, 0.94);
  stroke-width: 8;
  stroke-linecap: square;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.42));
}

.portal-logo-o {
  fill: rgba(9, 7, 18, 0.3);
  stroke: rgba(247, 221, 255, 0.96);
  stroke-width: 7;
  filter: url("#portalORingGlow") drop-shadow(0 0 24px rgba(172, 105, 255, 0.72));
}

.intro-mark p {
  margin: 0;
  color: rgba(251, 251, 243, 0.76);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
}

.eyebrow {
  margin: 0 0 6px;
  color: #c7b2ff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow.beacon-label,
.eyebrow.spark-label {
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.75rem, 2.2vw, 2.3rem);
  font-weight: 500;
  line-height: 1.06;
  margin-bottom: 0;
}

h2 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
}

h3 {
  font-size: 1rem;
  font-weight: 500;
}

p,
small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.52;
}

.partner-strip,
.pressure-card,
.quiet-card,
.insight-panel section,
.lens-card,
.settings-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.038)),
    rgba(10, 13, 32, 0.66);
  border-radius: 8px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.partner-strip,
.quiet-card,
.section-heading,
.share-row,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-row[hidden],
.privacy-preference[hidden],
.prompt-sharing-card[hidden],
.relationship-mode-controls[hidden],
.onboarding-pairing[hidden],
#cloudSyncEmailField[hidden],
#onboardCloudSyncEmailField[hidden] {
  display: none;
}

.section-heading > *,
.moment > div {
  min-width: 0;
}

.partner-strip strong,
.partner-strip small {
  display: block;
}

.in-screen {
  margin-top: 12px;
}

.screen .partner-strip {
  box-shadow: none;
}

.settings-hero {
  border: 1px solid rgba(255, 207, 154, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.038)),
    rgba(10, 13, 32, 0.66);
  margin-bottom: 14px;
}

.settings-hero img {
  width: 100%;
  height: 176px;
  object-fit: cover;
  object-position: 50% 54%;
  display: block;
}

.settings-hero div {
  padding: 14px;
}

.settings-hero h2 {
  margin-bottom: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
  margin-right: 7px;
  box-shadow: 0 0 16px rgba(201, 231, 138, 0.74);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.icon-button img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--lilac);
  padding: 4px;
  font-weight: 600;
}

.pressure-meter {
  height: 8px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pressure-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  box-shadow: 0 0 20px rgba(255, 196, 111, 0.34);
}

.weight-card h2 {
  margin-bottom: 12px;
}

.weight-card {
  background:
    linear-gradient(90deg, rgba(8, 9, 28, 0.94) 0%, rgba(12, 10, 34, 0.8) 58%, rgba(15, 10, 34, 0.62) 100%),
    linear-gradient(180deg, rgba(6, 7, 24, 0.08), rgba(6, 7, 24, 0.72)),
    url("../Images/portal-beacon-background.png") center / cover no-repeat;
  border-color: rgba(218, 183, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -36px 50px rgba(5, 6, 18, 0.28);
}

.segmented.weight-toggle {
  display: inline-flex;
  width: auto;
  grid-template-columns: none;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  margin-bottom: 0;
}

.segmented.weight-toggle button {
  min-width: 70px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
}

.tag-row,
.quick-replies,
.filter-row,
.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag,
.pill,
.quick-replies button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
}

.tag.active,
.pill.active,
.quick-replies button.active {
  border-color: rgba(255, 207, 154, 0.78);
  background: linear-gradient(135deg, rgba(123, 97, 216, 0.34), rgba(255, 122, 168, 0.16));
  box-shadow: var(--glow);
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  display: block;
  position: relative;
  border: 1px solid var(--line);
}

.switch span::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  position: absolute;
  top: 3px;
  left: 4px;
  transition: transform 160ms ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
}

.switch input:checked + span {
  background: linear-gradient(135deg, rgba(123, 97, 216, 0.76), rgba(255, 122, 168, 0.4));
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.phone-stage {
  display: grid;
  justify-items: center;
  align-items: start;
}

.phone-frame {
  width: min(100%, 430px);
  height: min(860px, calc(100vh - 44px));
  min-height: 680px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 196, 111, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(18, 24, 54, 0.98), rgba(5, 6, 18, 0.99)),
    var(--panel-strong);
  border: 1px solid rgba(205, 219, 255, 0.26);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 34px 110px rgba(2, 4, 18, 0.8),
    0 0 60px rgba(255, 122, 168, 0.16);
}

.screen {
  display: none;
  height: calc(100% - 74px - env(safe-area-inset-bottom));
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 24px;
  scrollbar-color: rgba(255, 207, 154, 0.45) transparent;
}

.screen.active {
  display: block;
}

.hero-moment {
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 207, 154, 0.24);
  background: #11163a;
  box-shadow: inset 0 -80px 80px rgba(5, 6, 18, 0.58);
}

.spark-hero-button {
  appearance: none;
  display: block;
  width: 100%;
  height: 168px;
  padding: 0;
  color: inherit;
  text-align: left;
  border-color: rgba(218, 183, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -36px 50px rgba(5, 6, 18, 0.28);
}

.spark-hero-button img {
  object-position: 50% 50%;
  filter: saturate(0.82) contrast(1.06) brightness(0.82);
}

.spark-hero-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.hero-moment img,
.lens-art,
.flow-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.08);
}

.flow-visual {
  height: 148px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 207, 154, 0.22);
  background: #101638;
  margin-bottom: 14px;
  box-shadow:
    inset 0 -60px 70px rgba(5, 6, 18, 0.58),
    0 14px 38px rgba(2, 4, 18, 0.28);
}

.flow-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 6, 18, 0.04), rgba(5, 6, 18, 0.24)),
    radial-gradient(circle at 50% 92%, rgba(255, 196, 111, 0.18), transparent 48%);
}

#screen-signals .flow-visual img,
#screen-lens .lens-art {
  object-position: 50% 50%;
}

#screen-repairs .flow-visual img {
  object-position: 50% 58%;
}

#screen-pilot .flow-visual img {
  object-position: 50% 54%;
}

#screen-home .hero-moment img {
  object-position: 50% 54%;
}

#screen-signals .flow-visual img {
  object-position: 50% 50%;
}

#screen-repairs .flow-visual {
  height: 164px;
}

#screen-lens .lens-art {
  object-position: 50% 54%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(8, 9, 28, 0.82) 0%, rgba(12, 10, 34, 0.48) 58%, rgba(15, 10, 34, 0.2) 100%),
    linear-gradient(180deg, rgba(6, 7, 24, 0.06), rgba(6, 7, 24, 0.78));
}

.hero-overlay h2 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.action-tile {
  min-height: 118px;
  border: 1px solid rgba(144, 112, 219, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 50%, rgba(206, 161, 255, 0.12), transparent 42%),
    linear-gradient(145deg, rgba(29, 31, 64, 0.9), rgba(7, 8, 23, 0.72));
  color: var(--ink);
  text-align: left;
  padding: 14px 12px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 4px 12px;
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.action-tile-charm-wide {
  grid-column: 1 / -1;
  min-height: 96px;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 14px;
  padding: 14px 16px;
  background:
    linear-gradient(90deg, rgba(7, 8, 22, 0.96), rgba(7, 8, 22, 0.78) 48%, rgba(7, 8, 22, 0.58)),
    radial-gradient(circle at 18% 54%, rgba(255, 199, 233, 0.18), transparent 36%),
    url("../Images/portal-charm-selected.png");
  background-size: 100% 100%, 100% 100%, cover;
  background-position: center, center, 50% 52%;
  overflow: hidden;
}

.action-tile-charm-wide .tile-icon {
  width: 64px;
  height: 64px;
}

.action-tile strong {
  align-self: end;
  font-weight: 500;
  font-size: 1.02rem;
}

.action-tile-charm-wide strong {
  font-size: 1.08rem;
}

.action-tile small {
  align-self: start;
  color: var(--lilac);
  overflow-wrap: anywhere;
}

.charm-board-button {
  width: 100%;
  min-height: 118px;
  margin: 12px 0 0;
  border: 1px solid rgba(144, 112, 219, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 50%, rgba(206, 161, 255, 0.12), transparent 42%),
    linear-gradient(145deg, rgba(29, 31, 64, 0.9), rgba(7, 8, 23, 0.72));
  color: var(--ink);
  text-align: left;
  padding: 14px 12px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 4px 12px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.charm-board-button strong {
  align-self: end;
  font-weight: 500;
  font-size: 1.02rem;
}

.charm-board-button small {
  align-self: start;
  color: var(--lilac);
  overflow-wrap: anywhere;
}

.action-tile:hover,
.charm-board-button:hover,
.bottom-nav button:hover,
.icon-button:hover,
.primary-button:hover,
.secondary-button:hover {
  border-color: rgba(255, 207, 154, 0.62);
  transform: translateY(-1px);
}

.tile-icon,
.nav-icon {
  display: block;
  position: relative;
  border-radius: 50%;
  background-image: var(--icon-image);
  background-repeat: no-repeat;
  background-size: 116% 116%;
  background-position: center;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}

.tile-icon::after,
.nav-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(151, 107, 225, 0.72);
  box-shadow: none;
}

.tile-icon-charm::after {
  border: 0;
}

.tile-icon {
  grid-row: 1 / span 2;
  width: 58px;
  height: 58px;
  place-self: center;
}

.tile-icon-signal {
  --icon-image: url("../Images/portal-icon-signal-centered.png?v=2");
  background-size: 110% 110%;
}

.tile-icon-spark {
  --icon-image: url("../Images/portal-icon-spark.png?v=2");
}

.tile-icon-repair {
  --icon-image: url("../Images/portal-icon-repair.png?v=2");
  background-size: 116% 120%;
  background-position: center 92%;
}

.tile-icon-lens {
  --icon-image: url("../Images/portal-icon-lens.png?v=2");
}

.tile-icon-atlas {
  --icon-image: url("../Images/portal-icon-atlas.png?v=2");
  /* Align the artwork's baked-in edge beneath the shared icon outline. */
  background-size: 122% 122%;
}

.tile-icon-rituals {
  --icon-image: url("../Images/portal-icon-rituals.png?v=2");
}

.tile-icon-charm {
  --icon-image: url("../Images/portal-icon-charm-centered.png");
}

.nav-icon {
  width: 26px;
  height: 26px;
  opacity: 0.84;
}

.nav-icon::after {
  box-shadow: none;
}

.nav-icon-today {
  --icon-image: url("../Images/portal-icon-today.png?v=2");
  background-size: auto 185%;
  background-position: 50% 30%;
}

.nav-icon-signal {
  --icon-image: url("../Images/portal-icon-signal.png?v=2");
  background-size: auto 139%;
  background-position: 70% 42%;
}

.nav-icon-repair {
  --icon-image: url("../Images/portal-icon-repair.png?v=2");
}

.nav-icon-atlas {
  --icon-image: url("../Images/portal-icon-atlas.png?v=2");
}

.nav-icon-you {
  --icon-image: url("../Images/portal-icon-you.png");
}

.bottom-nav button.active .nav-icon {
  opacity: 1;
  border-color: rgba(255, 207, 154, 0.52);
}

.moment-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f7fff7;
  background: linear-gradient(135deg, rgba(123, 97, 216, 0.58), rgba(255, 122, 168, 0.24));
  border: 1px solid rgba(255, 207, 154, 0.22);
}

.section-heading h3 {
  margin-bottom: 0;
}

.moment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.moment {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045));
}

.moment-icon {
  width: 38px;
  height: 38px;
}

.moment strong {
  display: block;
  font-size: 0.94rem;
  font-weight: 500;
}

.moment small {
  display: block;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.moment-photo {
  width: 100%;
  max-height: 128px;
  object-fit: cover;
  display: block;
  margin-top: 8px;
  border: 1px solid rgba(255, 207, 154, 0.18);
  border-radius: 6px;
}

.privacy-badge {
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--lilac);
  background: rgba(123, 97, 216, 0.16);
}

.flow-header {
  margin-bottom: 14px;
}

.choice-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.choice-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--ink);
  padding: 13px;
  text-align: left;
}

.choice-card.active {
  border-color: rgba(255, 207, 154, 0.72);
  background: linear-gradient(135deg, rgba(123, 97, 216, 0.32), rgba(255, 122, 168, 0.12));
}

.choice-card strong,
.choice-card small {
  display: block;
}

.field-label,
.repair-steps span {
  display: block;
  color: var(--ink);
  font-weight: 500;
  margin: 14px 0 7px;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 17, 18, 0.8);
  color: var(--ink);
  outline: none;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(5, 17, 18, 0.8);
  color: var(--ink);
  outline: none;
}

select option {
  color: #102024;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(122, 215, 232, 0.12);
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 207, 154, 0.45);
  border-radius: 8px;
  color: #061011;
  background: linear-gradient(135deg, #ffe4ae, #7ad7e8 52%, #ff7aa8);
  font-weight: 600;
  margin-top: 14px;
  box-shadow: 0 16px 36px rgba(255, 122, 168, 0.24);
}

/* Save actions inside feature tabs use a quieter, glass-like treatment. */
.screen .primary-button,
.onboarding-dialog .primary-button,
.spark-dialog .primary-button {
  border-color: rgba(255, 207, 154, 0.5);
  border-radius: 999px;
  color: rgba(251, 248, 255, 0.94);
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0%,
      rgba(231, 189, 218, 0.09) 42%,
      rgba(255, 225, 212, 0.13) 50%,
      rgba(231, 189, 218, 0.09) 58%,
      rgba(255, 255, 255, 0.015) 100%
    ),
    rgba(67, 43, 77, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(218, 174, 224, 0.05),
    0 7px 18px rgba(3, 4, 14, 0.18);
}

.screen .primary-button:hover,
.onboarding-dialog .primary-button:hover,
.spark-dialog .primary-button:hover {
  border-color: rgba(255, 218, 177, 0.72);
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0%,
      rgba(238, 199, 224, 0.12) 42%,
      rgba(255, 230, 216, 0.17) 50%,
      rgba(238, 199, 224, 0.12) 58%,
      rgba(255, 255, 255, 0.02) 100%
    ),
    rgba(73, 47, 84, 0.36);
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:disabled:hover {
  transform: none;
}

.intro-enter {
  position: relative;
  z-index: 3;
  width: auto;
  min-width: 118px;
  min-height: 34px;
  margin-top: 0;
  padding: 0 18px;
  border-color: rgba(255, 207, 154, 0.5);
  border-radius: 999px;
  color: rgba(251, 248, 255, 0.94);
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0%,
      rgba(231, 189, 218, 0.09) 42%,
      rgba(255, 225, 212, 0.13) 50%,
      rgba(231, 189, 218, 0.09) 58%,
      rgba(255, 255, 255, 0.015) 100%
    ),
    rgba(67, 43, 77, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(218, 174, 224, 0.05),
    0 7px 18px rgba(3, 4, 14, 0.18);
  font-size: 0.78rem;
  font-weight: 500;
}

.secondary-button {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-weight: 500;
  margin-top: 14px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  margin-bottom: 14px;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.segmented button.active {
  background: linear-gradient(135deg, rgba(123, 97, 216, 0.36), rgba(255, 122, 168, 0.16));
  color: var(--ink);
}

.dialog-art-band {
  height: 150px;
  margin: -18px -18px 16px;
  border-bottom: 1px solid rgba(205, 219, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(3, 8, 18, 0.02), rgba(4, 10, 18, 0.34) 52%, rgba(4, 10, 18, 0.88)),
    radial-gradient(circle at 50% 88%, rgba(255, 196, 111, 0.18), transparent 48%),
    url("../Images/portal-spark-selected.png");
  background-size: cover, 100% 100%, cover;
  background-position: center, center, 50% 54%;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 -48px 58px rgba(5, 6, 18, 0.52),
    0 12px 28px rgba(2, 4, 18, 0.22);
  pointer-events: none;
}

.spark-dialog form {
  background:
    linear-gradient(180deg, rgba(15, 30, 45, 0.96), rgba(5, 14, 22, 0.98));
}

.charm-dialog form {
  background:
    linear-gradient(180deg, rgba(24, 23, 45, 0.96), rgba(9, 11, 25, 0.98));
}

.charm-dialog-art {
  background:
    linear-gradient(180deg, rgba(3, 8, 18, 0.02), rgba(4, 10, 18, 0.34) 52%, rgba(4, 10, 18, 0.9)),
    radial-gradient(circle at 50% 88%, rgba(255, 154, 192, 0.18), transparent 48%),
    url("../Images/portal-charm-selected.png");
  background-size: cover, 100% 100%, cover;
  background-position: center, center, 50% 52%;
}

.charm-dialog-body {
  display: grid;
  gap: 12px;
}

.charm-dialog-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.cloud-connect-dialog {
  width: min(540px, calc(100vw - 28px));
}

.cloud-connect-dialog form {
  background:
    linear-gradient(180deg, rgba(13, 25, 43, 0.98), rgba(5, 14, 22, 0.98));
}

.cloud-connect-art {
  height: 136px;
  background:
    linear-gradient(180deg, rgba(3, 8, 18, 0.02), rgba(4, 10, 18, 0.4) 58%, rgba(4, 10, 18, 0.9)),
    radial-gradient(circle at 50% 92%, rgba(122, 215, 232, 0.16), transparent 48%),
    url("../Images/orientation-minimal-aperture.png");
  background-size: cover, 100% 100%, cover;
  background-position: center, center, center 72%;
}

.cloud-connect-body {
  display: grid;
  gap: 12px;
}

.cloud-connect-body .secondary-button {
  margin-top: 0;
}

.spark-dialog-body {
  display: grid;
  gap: 12px;
}

.spark-dialog-body h3 {
  font-size: 1.16rem;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.lens-card {
  padding: 10px;
}

.lens-art {
  height: 142px;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.lens-capture {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
}

.lens-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lens-photo-button {
  min-height: 62px;
  border: 1px solid rgba(144, 112, 219, 0.28);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background:
    radial-gradient(circle at 18% 50%, rgba(217, 178, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.lens-photo-button strong,
.lens-photo-button small {
  display: block;
}

.lens-photo-button strong {
  font-weight: 500;
}

.lens-photo-button small {
  color: var(--lilac);
}

.lens-photo-button.is-loading {
  border-color: rgba(122, 215, 232, 0.5);
  background:
    radial-gradient(circle at 18% 50%, rgba(122, 215, 232, 0.16), transparent 44%),
    rgba(255, 255, 255, 0.055);
}

.lens-photo-icon {
  width: 44px;
  height: 44px;
  border: 1px solid #8b63d4;
  border-radius: 50%;
  background: url("../Images/portal-icon-lens.png?v=2") center / 116% 116% no-repeat;
}

.lens-photo-preview {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 207, 154, 0.2);
  border-radius: 8px;
  background: rgba(5, 6, 18, 0.72);
}

.lens-photo-preview[hidden] {
  display: none;
}

.lens-photo-preview img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  display: block;
}

.lens-photo-preview .icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: rgba(5, 6, 18, 0.72);
  backdrop-filter: blur(10px);
}

#screen-lens textarea {
  min-height: 78px;
}

.constellation-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 207, 154, 0.22);
  border-radius: 8px;
  background: rgba(5, 6, 18, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 52px rgba(2, 4, 18, 0.34);
  margin-bottom: 12px;
}

.atlas-map {
  min-height: 236px;
}

.atlas-filter-row {
  margin-bottom: 12px;
}

.atlas-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.atlas-node {
  position: absolute;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--node-border, rgba(217, 215, 255, 0.72));
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5, 6, 18, 0.44);
  color: var(--ink);
  box-shadow: none;
  pointer-events: auto;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.atlas-node::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--node-color, var(--lilac));
  box-shadow: 0 0 16px var(--node-glow, rgba(217, 215, 255, 0.62));
}

.atlas-node::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--node-border, rgba(217, 215, 255, 0.62));
  opacity: 0;
  transform: scale(0.82);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.atlas-node-spark {
  --node-color: #d9d7ff;
  --node-border: rgba(217, 215, 255, 0.72);
  --node-glow: rgba(217, 215, 255, 0.62);
}

.atlas-node-repair {
  --node-color: #ff9ac0;
  --node-border: rgba(255, 154, 192, 0.72);
  --node-glow: rgba(255, 154, 192, 0.62);
}

.atlas-node-lens {
  --node-color: #7ad7e8;
  --node-border: rgba(122, 215, 232, 0.72);
  --node-glow: rgba(122, 215, 232, 0.62);
}

.atlas-node-ritual {
  --node-color: #ffc46f;
  --node-border: rgba(255, 196, 111, 0.72);
  --node-glow: rgba(255, 196, 111, 0.62);
}

.atlas-node.active {
  border-color: var(--node-color, var(--lilac));
  background: rgba(217, 178, 255, 0.12);
  transform: translate(-50%, -50%) scale(1.1);
}

.atlas-node.active::after,
.atlas-node:hover::after,
.atlas-node:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.atlas-node:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 4px;
}

.atlas-empty {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  text-align: center;
}

.moment-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 17, 18, 0.56);
}

.moment-detail h3 {
  margin-bottom: 8px;
}

.atlas-focus-card {
  margin-bottom: 12px;
}

.atlas-focus-detail {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 10px;
}

.atlas-focus-detail h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.atlas-focus-detail p {
  margin-bottom: 8px;
}

.atlas-focus-photo {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 207, 154, 0.18);
  border-radius: 6px;
}

.atlas-focus-icon,
.atlas-focus-empty span {
  width: 42px;
  height: 42px;
  border: 1px solid var(--node-border, rgba(217, 215, 255, 0.76));
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--node-glow, rgba(217, 215, 255, 0.72)) 0 10%, transparent 11%),
    rgba(5, 6, 18, 0.6);
}

.atlas-focus-icon-spark {
  --node-color: #d9d7ff;
  --node-border: rgba(217, 215, 255, 0.72);
  --node-glow: rgba(217, 215, 255, 0.62);
}

.atlas-focus-icon-repair {
  --node-color: #ff9ac0;
  --node-border: rgba(255, 154, 192, 0.72);
  --node-glow: rgba(255, 154, 192, 0.62);
}

.atlas-focus-icon-lens {
  --node-color: #7ad7e8;
  --node-border: rgba(122, 215, 232, 0.72);
  --node-glow: rgba(122, 215, 232, 0.62);
}

.atlas-focus-icon-ritual {
  --node-color: #ffc46f;
  --node-border: rgba(255, 196, 111, 0.72);
  --node-glow: rgba(255, 196, 111, 0.62);
}

.atlas-focus-empty {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.atlas-focus-empty p {
  margin: 0;
}

.constellation-art,
.charm-art {
  width: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.08);
}

.constellation-art {
  height: 236px;
}

.constellation-stats {
  position: absolute;
  inset: auto 10px 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.constellation-stats span {
  min-width: 0;
  border: 1px solid rgba(255, 207, 154, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(5, 6, 18, 0.72);
  backdrop-filter: blur(10px);
}

.constellation-stats strong,
.constellation-stats small {
  display: block;
}

.constellation-stats strong {
  color: var(--ink);
}

.charm-art {
  height: 120px;
  border: 1px solid rgba(255, 207, 154, 0.18);
  border-radius: 6px;
  margin-top: 2px;
}

.charm-panel {
  gap: 12px;
}

.charm-grid {
  display: grid;
  gap: 8px;
}

.charm-new-button {
  display: inline-grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  justify-self: stretch;
  min-height: 58px;
  border-color: rgba(144, 112, 219, 0.38);
  padding: 8px 14px 8px 10px;
  background:
    radial-gradient(circle at 18% 50%, rgba(206, 161, 255, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(29, 31, 64, 0.88), rgba(7, 8, 23, 0.74));
  color: var(--ink);
  text-align: left;
  font-size: 0.92rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 24px rgba(8, 6, 26, 0.32);
}

.charm-new-button .tile-icon {
  grid-row: auto;
  width: 42px;
  height: 42px;
}

.charm-new-button span:last-child {
  font-weight: 600;
  white-space: nowrap;
}

.charm-new-button:hover {
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 207, 154, 0.18), transparent 44%),
    linear-gradient(145deg, rgba(36, 32, 72, 0.92), rgba(8, 9, 24, 0.76));
}

.charm-card,
.pattern-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.charm-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.charm-card-top {
  display: flex;
  gap: 8px;
  align-items: center;
}

.charm-card-top strong {
  min-width: 0;
  flex: 1;
}

.charm-card-top small {
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.charm-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--charm-color, var(--amber));
  box-shadow: 0 0 18px var(--charm-glow, rgba(255, 207, 154, 0.54));
}

.charm-kind-kindness {
  --charm-color: #ffe4ae;
  --charm-glow: rgba(255, 228, 174, 0.58);
}

.charm-kind-effort {
  --charm-color: #7ad7e8;
  --charm-glow: rgba(122, 215, 232, 0.58);
}

.charm-kind-support {
  --charm-color: #a996ff;
  --charm-glow: rgba(169, 150, 255, 0.58);
}

.charm-kind-playfulness {
  --charm-color: #ff9ac0;
  --charm-glow: rgba(255, 154, 192, 0.58);
}

.charm-kind-growth {
  --charm-color: #9ee8b4;
  --charm-glow: rgba(158, 232, 180, 0.58);
}

.charm-kind-closeness {
  --charm-color: #ffc46f;
  --charm-glow: rgba(255, 196, 111, 0.58);
}

.charm-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.charm-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.charm-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.charm-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.charm-actions button:hover {
  border-color: rgba(255, 207, 154, 0.62);
}

.charm-card-saved {
  border-color: rgba(255, 207, 154, 0.4);
  background: rgba(255, 207, 154, 0.07);
}

.charm-returned {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 700;
}

.pattern-list {
  display: grid;
  gap: 8px;
}

.pattern-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
}

.pattern-item > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--pink);
  box-shadow: 0 0 18px rgba(255, 122, 168, 0.68);
}

.pattern-item strong,
.pattern-item small {
  display: block;
}

.settings-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-entry-card {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(8, 9, 28, 0.9) 0%, rgba(10, 10, 30, 0.74) 54%, rgba(8, 9, 27, 0.6) 100%),
    linear-gradient(180deg, rgba(7, 8, 24, 0.08), rgba(7, 8, 24, 0.62)),
    url("../Images/portal-settings-card-background.png") center / cover no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -30px 44px rgba(5, 6, 18, 0.26);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.settings-entry-card:hover {
  border-color: rgba(255, 207, 154, 0.56);
  transform: translateY(-1px);
}

.settings-entry-card:active {
  transform: translateY(0);
}

.settings-entry-image {
  width: 38px;
  height: 38px;
  display: block;
  border: 1px solid rgba(183, 133, 255, 0.36);
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(156, 104, 224, 0.13);
}

.settings-entry-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.settings-entry-copy strong {
  font-size: 1rem;
}

.settings-entry-copy small,
.settings-section-heading small,
.settings-option-button small {
  color: var(--muted);
}

.settings-entry-chevron {
  color: var(--lilac);
  font-size: 1.35rem;
  line-height: 1;
}

.settings-back-button {
  margin-bottom: 10px;
}

.settings-detail-header {
  margin-bottom: 14px;
}

.settings-section {
  gap: 12px;
}

.settings-section-heading {
  display: grid;
  gap: 4px;
}

.settings-section-heading h3,
.settings-section-heading p,
.settings-option-block h3,
.settings-option-block p {
  margin-bottom: 0;
}

.settings-option-block {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(205, 219, 255, 0.12);
  padding-top: 12px;
}

.settings-option-block[hidden],
[data-prototype-only][hidden] {
  display: none;
}

.settings-option-block .pairing-partner-name {
  border-top: 0;
  padding-top: 0;
}

.settings-option-button {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
}

.settings-option-button > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.settings-option-button > span:last-child {
  color: var(--lilac);
  font-size: 1.2rem;
}

.settings-option-button:hover {
  border-color: rgba(255, 207, 154, 0.56);
}

.settings-developer-section {
  border-color: rgba(205, 219, 255, 0.14);
  background: rgba(8, 10, 27, 0.48);
}

.settings-option-danger strong {
  color: #ffd6df;
}

.settings-actions-card .secondary-button {
  width: 100%;
}

.ritual-panel {
  display: none;
}

.ritual-panel.active {
  display: block;
}

.agreement-list {
  display: grid;
  gap: 8px;
}

.agreement-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.agreement-item strong,
.agreement-item small {
  display: block;
  padding-right: 80px;
}

.agreement-item .privacy-badge {
  position: absolute;
  top: 10px;
  right: 10px;
}

.ritual-shared-list {
  display: grid;
  gap: 10px;
}

.ritual-shared-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(184, 124, 255, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 14% 0%, rgba(184, 124, 255, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.045);
}

.ritual-shared-heading,
.ritual-response-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ritual-shared-heading {
  justify-content: space-between;
}

.ritual-shared-card strong,
.ritual-shared-card p,
.ritual-shared-card small {
  display: block;
}

.ritual-shared-card p {
  margin: 0;
}

.ritual-response-actions .compact-button {
  min-height: 38px;
}

.relationship-mode-card {
  gap: 12px;
}

#screen-settings .quiet-card + .relationship-mode-card {
  margin-top: 12px;
}

.relationship-mode-art {
  position: relative;
  height: 132px;
  border: 1px solid rgba(255, 207, 154, 0.2);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(5, 6, 18, 0.82);
  box-shadow:
    inset 0 -42px 54px rgba(5, 6, 18, 0.44),
    0 14px 38px rgba(2, 4, 18, 0.24);
}

.relationship-mode-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 6, 18, 0.02), rgba(5, 6, 18, 0.24)),
    radial-gradient(circle at 50% 100%, rgba(255, 196, 111, 0.12), transparent 48%);
}

.relationship-mode-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.96) contrast(1.06);
  transition: opacity 180ms ease;
}

.pairing-panel,
.onboarding-pairing {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(205, 219, 255, 0.13);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 6, 18, 0.34);
}

.pairing-panel-head,
.pairing-code-card,
.pairing-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pairing-panel-head > div,
.pairing-code-card span,
.pairing-entry-row input {
  min-width: 0;
}

.pairing-panel-head strong,
.pairing-panel-head small,
.pairing-code-card small,
.pairing-code-card strong,
.onboarding-pairing small {
  display: block;
}

.pairing-code-card {
  border: 1px solid rgba(255, 207, 154, 0.28);
  border-radius: 8px;
  padding: 10px;
  background:
    radial-gradient(circle at 18% 50%, rgba(217, 178, 255, 0.14), transparent 44%),
    rgba(255, 255, 255, 0.045);
}

.pairing-code-card[hidden],
.pairing-entry[hidden],
.pairing-partner-name[hidden],
.pairing-actions [hidden],
#onboardPairingCodeField[hidden] {
  display: none;
}

.pairing-code-card strong {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 600;
}

.pairing-entry .field-label {
  margin-top: 0;
}

.pairing-partner-name {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(205, 219, 255, 0.12);
  padding-top: 10px;
}

.pairing-entry-row input {
  min-height: 40px;
}

.compact-button {
  width: auto;
  min-width: 74px;
  min-height: 40px;
  margin-top: 0;
  padding: 0 14px;
}

.pairing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-generator-card {
  margin-bottom: 12px;
}

.date-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-context-actions .primary-button,
.date-context-actions .secondary-button {
  margin-top: 0;
}

.date-idea-map-link {
  justify-self: start;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.date-idea-map-link:hover {
  text-decoration: underline;
}

.date-venue-meta {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
}

.date-idea-section {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(205, 219, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.date-idea-section strong,
.date-idea-section small {
  display: block;
}

.date-plan-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.task-item input {
  width: 20px;
  min-height: 20px;
  margin: 2px 0 0;
  accent-color: var(--cyan);
}

.task-item strong,
.task-item small {
  display: block;
}

.rating-row {
  margin-bottom: 2px;
}

.rating-row .pill {
  min-width: 42px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bottom-nav {
  position: absolute;
  inset: auto 0 0;
  z-index: 50;
  height: calc(74px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  gap: 6px;
  background: rgba(4, 12, 13, 0.96);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transform: translateZ(0);
}

.bottom-nav button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--soft);
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
}

.bottom-nav button.active {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(123, 97, 216, 0.28), rgba(255, 255, 255, 0.07));
  border-color: var(--line);
}

.insight-panel {
  display: none;
  gap: 16px;
  align-content: start;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid div {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.metric-grid strong {
  display: block;
  font-size: 1.55rem;
  color: var(--lilac);
}

.decision-list p {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  background: linear-gradient(180deg, rgba(15, 39, 42, 0.98), rgba(6, 17, 18, 0.98));
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(1, 8, 9, 0.76);
  backdrop-filter: blur(5px);
}

dialog form {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

dialog form > *:not(.privacy-dialog-art) {
  position: relative;
  z-index: 2;
}

#privacyDialog form::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 17, 18, 0.78), rgba(6, 17, 18, 0.52)),
    radial-gradient(circle at 52% 48%, rgba(7, 9, 24, 0.08), rgba(7, 9, 24, 0.58) 72%);
}

.privacy-dialog-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.32;
  filter: saturate(0.95) contrast(1.05);
  pointer-events: none;
}

.onboarding-dialog {
  width: min(620px, calc(100vw - 28px));
}

.onboarding-dialog form {
  max-height: min(760px, calc(100dvh - 28px));
  overflow-y: auto;
}

.orientation-hero {
  height: 152px;
  margin: -18px -18px 14px;
  border-bottom: 1px solid rgba(205, 219, 255, 0.15);
  background:
    linear-gradient(180deg, rgba(5, 9, 20, 0.02), rgba(5, 9, 20, 0.42) 54%, rgba(5, 9, 20, 0.9)),
    radial-gradient(circle at 52% 84%, rgba(255, 196, 111, 0.16), transparent 46%),
    radial-gradient(circle at 50% 48%, rgba(217, 178, 255, 0.12), transparent 42%),
    url("../Images/orientation-minimal-aperture.png");
  background-size: cover, 100% 100%, 100% 100%, cover;
  background-position: center, center, center, center 72%;
  box-shadow:
    inset 0 -48px 58px rgba(5, 6, 18, 0.54),
    0 12px 28px rgba(2, 4, 18, 0.22);
}

.onboarding-dialog .dialog-head {
  justify-content: center;
  margin: -2px 0 12px;
  padding-bottom: 0;
  border-bottom: 0;
}

.onboarding-dialog .dialog-head .eyebrow {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 178, 255, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  background:
    radial-gradient(circle at 50% 100%, rgba(122, 215, 232, 0.08), transparent 58%),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin-bottom: 0;
}

.onboarding-dialog .form-grid .field-label {
  margin-top: 0;
  color: var(--soft);
}

.onboarding-dialog .form-grid {
  grid-template-columns: minmax(0, 360px);
  justify-content: center;
  width: min(100%, 420px);
  margin: 0 auto 14px;
  border: 1px solid rgba(205, 219, 255, 0.12);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 178, 255, 0.11), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(5, 17, 18, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.onboarding-dialog .form-grid label {
  text-align: center;
}

.onboarding-dialog #onboardUser {
  min-height: 52px;
  text-align: center;
  font-size: 1.05rem;
}

.orientation-section {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(205, 219, 255, 0.13);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 6, 18, 0.34);
}

.orientation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.orientation-grid:not(.compact-grid) .orientation-option:first-child {
  grid-column: 1 / -1;
}

.orientation-option {
  min-width: 0;
  min-height: 86px;
  text-align: left;
  border: 1px solid rgba(205, 219, 255, 0.14);
  border-radius: 8px;
  padding: 10px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.045);
}

.orientation-option.active {
  color: var(--ink);
  border-color: rgba(255, 207, 154, 0.58);
  background:
    linear-gradient(135deg, rgba(123, 97, 216, 0.36), rgba(255, 122, 168, 0.16)),
    rgba(255, 255, 255, 0.06);
}

.orientation-option strong,
.orientation-option small,
.orientation-toggle strong,
.orientation-toggle small {
  display: block;
}

.orientation-toggle {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid rgba(205, 219, 255, 0.13);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.orientation-toggle input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--cyan);
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.compact {
  margin-bottom: 0;
}

.privacy-states {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.privacy-states span {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.privacy-preference {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid rgba(205, 219, 255, 0.12);
  padding-top: 14px;
}

.prompt-sharing-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.prompt-sharing-card h3,
.prompt-sharing-card p {
  margin-bottom: 0;
}

.prompt-sharing-card .primary-button {
  margin-top: 4px;
}

.cloud-sync-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  background:
    radial-gradient(circle at 12% 16%, rgba(122, 215, 232, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.036)),
    rgba(10, 13, 32, 0.72);
}

#screen-settings-detail .cloud-sync-card {
  margin-top: 0;
  background: transparent;
}

.onboarding-cloud-sync {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(122, 215, 232, 0.22);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at 12% 20%, rgba(122, 215, 232, 0.11), transparent 36%),
    linear-gradient(135deg, rgba(29, 31, 64, 0.64), rgba(5, 17, 18, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cloud-sync-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.cloud-sync-heading > div {
  min-width: 0;
}

.cloud-sync-orb {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(122, 215, 232, 0.4);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(217, 178, 255, 0.85) 0 16%, rgba(122, 215, 232, 0.16) 17% 48%, transparent 49%),
    rgba(5, 6, 18, 0.64);
  box-shadow: 0 0 26px rgba(122, 215, 232, 0.14);
}

.cloud-sync-card h3,
.cloud-sync-card p,
.onboarding-cloud-sync h3,
.onboarding-cloud-sync p,
.onboarding-cloud-sync small {
  margin-bottom: 0;
}

.cloud-sync-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.cloud-sync-form label {
  min-width: 0;
}

.cloud-sync-form .secondary-button {
  margin-top: 0;
}

.cloud-sync-form .compact-button {
  min-width: 136px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: rgba(8, 25, 26, 0.96);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: 180ms ease;
  max-width: min(440px, calc(100vw - 28px));
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.save-confirmation {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 86px;
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr auto 38px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 207, 154, 0.38);
  border-radius: 8px;
  padding: 10px;
  background: rgba(8, 25, 26, 0.96);
  box-shadow: var(--shadow);
}

.save-confirmation[hidden] {
  display: none;
}

.save-confirmation strong,
.save-confirmation small {
  display: block;
}

.save-confirmation.partner-notification {
  left: 50%;
  right: auto;
  top: 50%;
  width: min(340px, calc(100% - 32px));
  grid-template-columns: 1fr 40px;
  gap: 14px;
  padding: 22px;
  transform: translate(-50%, -50%);
  border-color: rgba(185, 124, 255, 0.72);
  background:
    radial-gradient(circle at 22% 18%, rgba(185, 124, 255, 0.22), transparent 44%),
    rgba(13, 14, 34, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), 0 0 42px rgba(166, 108, 255, 0.24);
  text-align: left;
}

.save-confirmation.partner-notification::before {
  content: "";
  position: absolute;
  inset: -180px -40px;
  z-index: -1;
  background: rgba(3, 4, 14, 0.56);
  backdrop-filter: blur(2px);
}

.save-confirmation.partner-notification div {
  min-width: 0;
}

.save-confirmation.partner-notification strong {
  margin-bottom: 8px;
  font-size: 1.08rem;
  line-height: 1.2;
}

.save-confirmation.partner-notification small {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.45;
}

.save-confirmation.partner-notification .text-button {
  grid-column: 1 / -1;
  justify-self: stretch;
  min-height: 42px;
  border: 1px solid rgba(185, 124, 255, 0.42);
  border-radius: 8px;
  background: rgba(185, 124, 255, 0.16);
  color: var(--ink);
  font-weight: 700;
}

.save-confirmation.partner-notification .icon-button {
  width: 40px;
  height: 40px;
}

.hidden-mode .phone-frame {
  filter: blur(8px);
}

.hidden-mode::after {
  content: "Neutral screen active";
  position: fixed;
  inset: 22px;
  display: grid;
  place-items: center;
  background: #08191a;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 20;
  font-weight: 500;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: minmax(310px, 430px);
  }

  .phone-stage {
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  body {
    background: linear-gradient(180deg, #101638, #070918);
  }

  body::before,
  .context-panel,
  .insight-panel {
    display: none;
  }

  body.portal-intro-active .app-shell,
  body.portal-intro-leaving .app-shell {
    min-height: 100svh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 0;
  }

  body.portal-intro-active .context-panel,
  body.portal-intro-leaving .context-panel {
    display: grid;
    width: 100vw;
    max-width: none;
    height: 100svh;
    height: 100dvh;
    margin: 0;
  }

  body.portal-intro-active .phone-stage,
  body.portal-intro-leaving .phone-stage {
    display: none;
  }

  .app-shell {
    display: block;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
  }

  .phone-stage {
    display: block;
    width: 100%;
    overflow-x: hidden;
  }

  body.portal-intro-active .phone-stage,
  body.portal-intro-active .insight-panel {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  body.portal-intro-ready .phone-stage {
    display: block;
  }

  .phone-frame {
    width: 100%;
    max-width: 100vw;
    height: 100svh;
    min-height: 100svh;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    overflow: hidden;
  }

  .screen {
    height: calc(100vh - 74px - env(safe-area-inset-bottom));
    height: calc(100dvh - 74px - env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  .hero-overlay h2 {
    font-size: 1.1rem;
    line-height: 1.15;
  }

  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-tile {
    min-width: 0;
  }

  .bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }

  .bottom-nav button {
    min-width: 0;
  }

  .bottom-nav small {
    font-size: 0.66rem;
  }

  .form-grid,
  .orientation-grid,
  .cloud-sync-form {
    grid-template-columns: 1fr;
  }

  .cloud-sync-form .compact-button {
    width: 100%;
  }

  .orientation-grid:not(.compact-grid) .orientation-option:first-child {
    grid-column: auto;
  }

  .orientation-hero {
    height: 104px;
  }

  .dialog-art-band {
    height: 148px;
  }

  .intro-panel {
    min-height: 100svh;
    min-height: 100dvh;
    grid-template-rows: minmax(72px, 1fr) auto 22px auto minmax(36px, 0.72fr);
    align-content: stretch;
    place-items: center;
    padding:
      max(24px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      max(22px, env(safe-area-inset-bottom))
      max(18px, env(safe-area-inset-left));
    gap: 0;
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(2, 2, 8, 0.02), rgba(2, 2, 8, 0.08) 62%, rgba(2, 2, 8, 0.46)),
      url("../Images/portal-introduction-space-for-two.png") 50% 50% / contain no-repeat,
      #020208;
  }

  .intro-mark {
    grid-row: 2;
    width: min(100%, 356px);
    gap: 14px;
    padding: 0;
  }

  .portal-wordmark {
    width: min(82vw, 330px);
  }

  .intro-mark p {
    max-width: 270px;
    font-size: 0.72rem;
    line-height: 1.45;
    letter-spacing: 0;
  }

  .intro-enter {
    grid-row: 4;
    min-width: 132px;
    min-height: 36px;
    padding: 0 20px;
    font-size: 0.76rem;
  }
}

@media (max-width: 380px) and (max-height: 720px) {
  .intro-panel {
    grid-template-rows: minmax(50px, 0.8fr) auto 18px auto minmax(24px, 0.5fr);
    padding:
      max(18px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    background-position: 50% 45%;
  }

  .portal-wordmark {
    width: min(80vw, 300px);
  }

  .intro-mark {
    gap: 10px;
  }

  .intro-mark p {
    font-size: 0.68rem;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .context-panel,
  .phone-stage,
  .insight-panel {
    animation: none;
  }

  .intro-portal-o,
  .intro-portal-o::before,
  .intro-portal-o::after {
    animation: none;
    transition: none;
  }

  .intro-portal-o::before {
    opacity: var(--portal-o-halo-opacity);
    transform: scale(1) translateZ(0);
    filter: none;
  }

  .intro-portal-o::after {
    --portal-o-x: 50%;
    --portal-o-y: 50%;
    opacity: 0.52;
    transform: none;
  }
}
