/* Hilove V2.0. Theme scoped to the experience outside basic management. */
body.gray {
  background: #f3f3f3;
  filter: none;
}

body.gray :is(header.top, .steps, .annotate, .canvas-label, .canvas-bottom),
body.gray .phone:not(:has(#phoneSurface[data-hifi], #launchWelcome:not([hidden]))) {
  filter: grayscale(1);
}

#phoneSurface:is([data-hifi], :has(#launchWelcome:not([hidden]))) {
  --brand-purple: #844cec;
  --brand-ink: #60439a;
  --body-ink: #555656;
  --subdued-text: #888;
  --lilac-paper: #fbf8ff;
  --lavender: #f1eaf9;
  --lavender-line: #e8dff2;
  --rose-paper: #fff5f5;
  --rose-ink: #823c51;
  --glass-radius: 14px;
  --setup-background: linear-gradient(0deg, rgb(235 227 250 / 92.5%) 0%, #f8e6ef 33.928%, #fff 78.162%, #ebe3fa 108.84%);
  --soft-white: rgb(255 255 255 / 85%);
  --surface-shadow: 0 .5px 4px rgb(182 182 182 / 25%);
  font-family: "Noto Sans SC", "Noto Sans CJK SC", "Microsoft Yahei", sans-serif;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

#phoneSurface:is([data-hifi="connect"], [data-hifi="setup"]) {
  border-radius: 28px;
  background-image: var(--setup-background);
}

#phoneSurface:is([data-hifi="home"], [data-hifi="review"], [data-hifi="chat"], [data-hifi="history"], [data-hifi="historyDetail"]) {
  --statusbar-height: 74px;
  --chat-nav-height: 56px;
  border-radius: 32px;
}

#phoneSurface[data-hifi="home"] { background-image: url("hifi/home-background.svg"); }
#phoneSurface:is([data-hifi="review"], [data-hifi="chat"], [data-hifi="history"], [data-hifi="historyDetail"]) { background-image: url("hifi/review-background.svg"); }

#phoneSurface:is([data-hifi], :has(#launchWelcome:not([hidden]))) .island {
  background: #333;
  border-radius: 23px;
}

#phoneSurface:is([data-hifi], :has(#launchWelcome:not([hidden]))) .homebar {
  position: absolute;
  inset: auto 0 12px;
  margin: 0 auto;
}

#phoneSurface[data-hifi="connect"] .belt-intro h1,
#phoneSurface[data-hifi="connect"] .belt-intro p {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

#phoneSurface[data-hifi="connect"] .belt-intro h1 {
  top: calc(17.7824cqh - 70px);
  width: min(240px, 100%);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 54px;
  color: var(--brand-purple);
}

#phoneSurface[data-hifi="connect"] .belt-intro p {
  top: calc(24.7908cqh - 70px);
  display: grid;
  place-items: center;
  min-height: 35px;
  width: min(350px, 100% - 36px);
  font-size: 14px;
  line-height: 1.55;
  color: var(--subdued-text);
}

#phoneSurface[data-hifi="connect"] .belt-intro .setup-belt {
  top: calc(50cqh - 66px);
  width: min(196px, 45cqw);
  height: auto;
  aspect-ratio: 196 / 152;
}

#phoneSurface:is([data-hifi="connect"], [data-hifi="setup"]) #footer:not(:empty) {
  padding: 8px 24px 5.4393cqh;
  gap: 18px;
  background: transparent;
}

#phoneSurface:is([data-hifi="connect"], [data-hifi="setup"]) #footer .button {
  height: 60px;
  font-size: 20px;
  background: rgb(132 76 236 / 85%);
  border-color: transparent;
  border-radius: 30px;
  box-shadow: var(--surface-shadow);
}

#phoneSurface:is([data-hifi="connect"], [data-hifi="setup"]) #footer .secondary {
  color: var(--subdued-text);
  background: rgb(255 255 255 / 90%);
  border: .5px solid #ddd;
}

#phoneSurface[data-hifi] .nav:has(.chat-nav-icon) {
  padding: 0 21px 0 24px;
}

#phoneSurface[data-hifi] .nav .chat-nav-icon {
  position: relative;
  isolation: isolate;
  min-width: 34px;
  width: 34px;
  height: 34px;
  align-self: flex-start;
  margin-top: 3px;
  color: #383838;
}

#phoneSurface[data-hifi] .nav .chat-nav-icon::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -3.5px -4px -4.5px;
  background: url("hifi/nav-circle.svg") center no-repeat;
}

.chat-nav-actions {
  display: flex;
  align-self: flex-start;
  gap: 12px;
}

.new-chat-glyph { display: block; width: 19px; height: 19px; }

#phoneSurface[data-hifi] .nav:has(.chat-nav-icon) .nav-center {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hilove-wordmark, .profile-glyph {
  display: block;
  position: relative;
  overflow: hidden;
}

.hilove-wordmark {
  position: absolute;
  width: 67px;
  height: 17px;
  top: 10px;
  left: calc(50% - .5px);
  transform: translateX(-50%);
}

.hilove-wordmark img {
  position: absolute;
  width: 116.62%;
  height: 329.05%;
  left: -9.4%;
  top: -110.8%;
}

.profile-glyph { width: 17px; height: 21px; }
.profile-glyph img { width: 123.53%; height: 100%; transform: translateX(-9.52%); }

#phoneSurface[data-hifi] .nav-center small {
  position: absolute;
  inset: 37px 0 auto;
  margin: 0;
  line-height: 16px;
  font-size: 10px;
}

#phoneSurface[data-hifi] .nav-center small .connection-dot {
  background: var(--brand-purple);
  width: 9px;
  height: 9px;
  margin-right: 9px;
}

#phoneSurface[data-hifi] .nav-center small .connection-dot.offline {
  background: #db4758;
  border: 0;
}

#phoneSurface[data-hifi] #footer:has(.composer) {
  padding: 0 20px 35px;
  background: transparent;
}

#phoneSurface[data-hifi] .composer {
  height: 71px;
  padding: 0 10.5px 0 20px;
  gap: 13.5px;
  border: .5px solid #ddd;
  border-radius: 50px;
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--surface-shadow);
}

#phoneSurface[data-hifi] .composer input { font-size: 13px; }
#phoneSurface[data-hifi] .composer .composer-plus {
  flex-basis: 24px;
  letter-spacing: -6px;
  color: var(--subdued-text);
  font-size: 30px;
  transform: translateX(-4px);
}

#phoneSurface[data-hifi] .composer .composer-mic,
#phoneSurface[data-hifi] .composer .send {
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  border-radius: 50%;
  background: var(--brand-purple) url("hifi/mic-circle.svg") center no-repeat;
}

#phoneSurface[data-hifi] .composer .composer-mic img { transform: scaleX(-1); }

#phoneSurface[data-hifi] #screen:has(.chat-intro) { padding: 0 24px; }

#phoneSurface[data-hifi] .chat-intro {
  padding-top: clamp(42px, calc(26.2552cqh - 130px), 121px);
}

#phoneSurface[data-hifi] .orb-slot {
  width: 123px;
  height: 123px;
  flex: 0 0 123px;
  border: 0;
  transform: translateX(.5px);
}

.agent-orb {
  position: relative;
  overflow: hidden;
  mask-image: radial-gradient(circle closest-side, #000 87%, transparent 100%);
}

.agent-orb img {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 224%;
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%);
}

@media (prefers-reduced-motion: no-preference) {
  .chat-home-orb {
    overflow: visible;
    mask-image: none;
    mix-blend-mode: multiply;
  }

  .chat-home-orb img {
    filter: brightness(1.02);
    /* Keep the feather around the vertical jump path and blend the GIF's outer backdrop into the page. */
    mask-image: radial-gradient(ellipse 28% 39% at 50% 48%, #000 82%, transparent 100%);
  }
}

#phoneSurface[data-hifi] .chat-intro h1 {
  margin: 25px 0 2px;
  font: 500 clamp(29px, 8.182cqw, 36px)/1.45 Inter, system-ui, sans-serif;
  letter-spacing: 0;
  color: #000;
}

#phoneSurface[data-hifi] .chat-intro h1 span { color: var(--brand-purple); }
#phoneSurface[data-hifi] .intro-line { color: var(--subdued-text); font-size: 14px; }
#phoneSurface[data-hifi] .intro-actions { width: 100%; margin-top: 49px; gap: 8px; }

#phoneSurface[data-hifi] :is(.home-prompt, .story-followups button) {
  display: grid;
  align-items: center;
  line-height: 1.5;
  text-align: center;
}

#phoneSurface[data-hifi] :is(.home-prompt, .story-followups button) > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#phoneSurface[data-hifi] .home-prompt {
  box-sizing: border-box;
  width: min(170px, 100%);
  min-width: 0;
  min-height: 36px;
  grid-template-columns: 16px minmax(0, 1fr) 16px;
  column-gap: 4px;
  padding: 5px 10px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: var(--soft-white);
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
}

.home-prompt img {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  object-fit: contain;
  transform: translateY(var(--prompt-icon-offset, -.25px));
}
.home-prompt span { grid-area: 1 / 2; }
.home-prompt[data-topic="settings"] > span {
  /* Align with the start of the six-character labels above. */
  text-align: start;
  text-indent: max(0px, calc(50% - 3em));
  white-space: nowrap;
}
/* The heart and trend assets have uneven transparent padding. */
.home-prompt[data-topic="knowledge"] img { --prompt-icon-offset: -1.25px; }
.home-prompt[data-topic="weekly"] img { --prompt-icon-offset: -1px; }
.home-prompt[data-topic="device"] img { filter: brightness(.65); }
#phoneSurface .home-prompt[data-topic="daily"] { color: #d897bf; }
#phoneSurface .home-prompt[data-topic="weekly"] { color: #7b76bd; }
#phoneSurface .home-prompt[data-topic="knowledge"] { color: #45823b; }
#phoneSurface .home-prompt[data-topic="report"] { color: #bd7238; }
#phoneSurface[data-hifi] .home-prompt:hover { background: #fff; }

#phoneSurface[data-hifi] #screen:is([data-view="chat"], [data-view="history"]):not(:has(.chat-intro)) { padding: 18px 24px 20px; }

#phoneSurface[data-hifi] #screen .date-rule {
  margin: 0 0 22px;
  min-height: 18px;
  gap: 16px;
  color: var(--subdued-text);
  font-size: 12px;
  line-height: 18px;
}

#phoneSurface[data-hifi] .date-rule::before,
#phoneSurface[data-hifi] .date-rule::after {
  height: .5px;
  background: #aaa;
}

#phoneSurface[data-hifi] #screen .date-rule + .bubble-wrap:has(.userbubble) { margin: 0; }

#phoneSurface[data-hifi] #screen[data-view="chat"] > .bubble-wrap:has(> .userbubble):has(+ .story-message > .reply-prose) {
  margin-block-end: 0;
}
#phoneSurface[data-hifi] #screen[data-view="chat"] > .bubble-wrap:has(> .userbubble) + .story-message:has(> .reply-prose) {
  margin-block-start: 14px;
}

#phoneSurface[data-hifi] #screen .bubble-wrap .userbubble {
  border-radius: 14px 14px 0 14px;
  padding: 9px 14px;
  line-height: 21px;
  color: white;
  background: linear-gradient(90deg, rgb(160 123 228 / 75%), rgb(132 76 236 / 90%));
}

#phoneSurface[data-hifi] #screen .story-reply {
  padding: 8px 13px;
  border: 1px solid #fff;
  border-radius: 14px 14px 14px 0;
  background: var(--soft-white);
  color: #555656;
  line-height: 21px;
}

#phoneSurface[data-hifi] #screen .reply-prose {
  --reply-heading: #40334b;
  --reply-link: #594675;
  min-width: 0;
  margin: 0;
  padding: 10px 14px 9px;
  color: #49444d;
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
}
#phoneSurface[data-hifi] #screen .reply-prose > * { margin: 0; }
#phoneSurface[data-hifi] #screen .reply-prose > p {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
#phoneSurface[data-hifi] #screen .reply-prose > * + * { margin-block-start: 8px; }
#phoneSurface[data-hifi] #screen .reply-prose > * + h3 { margin-block-start: 12px; }
#phoneSurface[data-hifi] #screen .reply-prose > h3 + * { margin-block-start: 4px; }
.reply-prose h3 { color: var(--reply-heading); font-size: 14px; font-weight: 650; line-height: 1.45; }
.reply-prose strong { color: var(--reply-heading); font-weight: 650; }
.reply-prose :is(ul,ol) { padding-inline-start: 1.35em; }
.reply-prose li + li { margin-block-start: 3px; }
.reply-prose li::marker { color: var(--reply-link); }
.reply-prose hr { border: 0; border-block-start: 1px solid var(--lavender-line); }
.reply-prose :is(code,pre) { background: var(--lilac-paper); border-radius: 6px; }
.reply-prose code { padding: 1px 3px; }
.reply-prose pre { overflow-x: auto; max-width: 100%; padding: 7px 9px; font-size: 12px; }
.reply-prose pre code { padding: 0; }
.reply-prose a { color: var(--reply-link); text-underline-offset: 2px; }
.reply-progress { margin: 4px 0; color: var(--subdued-text); font-size: 12px; }

#phoneSurface[data-hifi] #screen .story-message > .reply-prose + :is(.card,.daily-card,.weekly-card,.growth-proposal,.actions) {
  margin-block-start: 9px;
}

#phoneSurface[data-hifi] #screen .story-message > .reply-prose + .health-sources {
  margin: 6px 0 0;
  padding-inline: 4px;
}

#phoneSurface[data-hifi] #screen .story-message > .health-sources > a {
  color: #6a5b78;
  overflow-wrap: anywhere;
}

#phoneSurface[data-hifi] .daily-card {
  position: relative;
  border: 1px solid #fff;
  border-radius: 14px;
  padding: 9px 15px 9px;
  background: var(--soft-white);
}

#phoneSurface[data-hifi] #screen :has(> .card-agent) { position: relative; }

.card-agent {
  position: absolute;
  top: -39px;
  right: 19.5px;
  z-index: 1;
  display: block;
  width: 65px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.card-agent picture, .card-agent img { display: block; }
.card-agent picture { transition: opacity 120ms ease-out, visibility 0s; }
.card-agent:focus-visible { outline: 2px solid var(--brand-purple); outline-offset: 2px; }
.card-agent[data-orb-feedback="still"] { box-shadow: 0 0 0 2px var(--lavender-line); }
.card-agent[data-orb-feedback="playing"] picture {
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s, 120ms;
}
.card-agent > .card-agent-feedback {
  position: absolute;
  left: 50%;
  top: calc(50% + .55px);
  /* The two GIFs have different canvases around the same 300 px orb. */
  width: calc(100% * 560 / 544);
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 120ms ease-out;
  pointer-events: none;
}
.card-agent > .card-agent-feedback[data-orb-visible] { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .card-agent picture, .card-agent > .card-agent-feedback { transition: none; }
}

#phoneSurface[data-hifi] #screen .story-message:has(.card-agent) > .story-reply {
  max-width: calc(100% - 92px);
}

#phoneSurface[data-hifi] #screen > .connect-device-card,
#phoneSurface[data-hifi] #screen .story-message > :has(> .card-agent):first-child {
  margin-top: 44px;
}

#phoneSurface[data-hifi] .daily-card .caption {
  font-size: 12px;
  line-height: 18px;
  color: var(--subdued-text);
  margin-bottom: 6px;
}

#phoneSurface[data-hifi] .daily-card > p {
  font-size: 14px;
  line-height: 23px;
  color: #555656;
  margin-bottom: 9px;
}

#phoneSurface[data-hifi] .story-plot {
  border-radius: 14px;
  background: var(--lilac-paper);
  box-shadow: inset 0 0 0 1px #f4edfb;
}

#phoneSurface[data-hifi] .story-plot span {
  top: 12px;
  right: 20px;
  color: var(--brand-purple);
  font: 15px/1.45 Inter, system-ui, sans-serif;
}

#phoneSurface[data-hifi] .source-row {
  min-height: 16px;
  margin-top: 9px;
  color: var(--subdued-text);
  line-height: 16px;
}

#phoneSurface[data-hifi] .story-followups { margin: 12px 0 0; gap: 8px 14px; }

#phoneSurface[data-hifi] .story-followups button {
  min-width: 0;
  min-height: 34px;
  max-width: 100%;
  padding: 5px 14px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: var(--soft-white);
  box-shadow: 0 .1px 4px rgb(182 182 182 / 15%);
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #555656;
}

#phoneSurface[data-hifi] :is(.home-prompt, .story-followups button):is([data-topic="device"], [data-topic="sync"]) {
  border-color: #ddcff5;
  background: #f6efff;
  color: #5d3997;
  font-weight: 600;
}

#phoneSurface[data-hifi] :is(.home-prompt, .story-followups button):is([data-topic="device"], [data-topic="sync"]):hover {
  background: #eee3fc;
}

#phoneSurface[data-hifi] :is(button, input):focus-visible {
  outline-color: var(--brand-purple);
}

#phoneSurface[data-hifi] .health-tip-card {
  max-width: 100%;
  padding: var(--card-inset, 16px);
  border-color: var(--lavender-line);
  border-radius: var(--card-radius, 16px);
  background: var(--lilac-paper);
  box-shadow: var(--surface-shadow);
}
#phoneSurface[data-hifi] .health-tip-card > .caption {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; color: var(--brand-ink);
}
#phoneSurface[data-hifi] .health-tip-card h3 { margin: 0 0 8px; }
#phoneSurface[data-hifi] .health-tip-card :is(p,h3,h4) { overflow-wrap: break-word; }
#phoneSurface[data-hifi] .health-tip-sections { display: grid; gap: 6px; list-style: none; margin: 12px 0; padding: 0; }
#phoneSurface[data-hifi] .health-tip-sections li { padding: 8px 10px; border-radius: 10px; background: var(--lilac-paper); }
#phoneSurface[data-hifi] .health-tip-sections h4 { margin: 0 0 3px; color: var(--brand-ink); font-size: 13px; }
#phoneSurface[data-hifi] .health-tip-sections p { margin: 0; font-size: 13px; }
#phoneSurface[data-hifi] .health-tip-card .health-tip-note { margin: 0 0 10px; font-size: 13px; color: var(--brand-ink); }
#phoneSurface[data-hifi] .health-sources { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; }
#phoneSurface[data-hifi] .health-sources a { font-size: 11px; line-height: 1.5; color: var(--brand-ink); text-underline-offset: 2px; }

/* Startup and the pairing flow. */
#phoneSurface #launchWelcome {
  background: #fcf9fd url("hifi/home-background.svg") center / 100% 100% no-repeat;
}

#launchWelcome .launch-english {
  display: grid;
  justify-items: center;
  gap: 10px;
  font-family: Inter, system-ui, sans-serif;
  color: #38323e;
}

.hilove-purple-mark {
  display: block;
  width: min(32cqw, 138px);
  aspect-ratio: 1568 / 398;
  background-color: var(--brand-purple);
  /* Align the visible mark inside the transparent padding of the source PNG. */
  mask: url("hifi/logo.png") 57.42% 48.30% / 116.33% 321.61% no-repeat;
}

#launchWelcome .launch-greeting { color: var(--body-ink); }

#launchWelcome .launch-orb {
  display: block;
  position: absolute;
  top: 49%;
  width: min(56cqw, 246px);
}

#phoneSurface[data-hifi="historyDetail"] .nav { padding-inline: 24px; }

#phoneSurface[data-hifi] .nav .back {
  position: relative;
  align-self: flex-start;
  margin-top: calc(77px - var(--statusbar-height));
  width: 34px;
  height: 34px;
  min-width: 34px;
  font-size: 0;
}

#phoneSurface[data-hifi] .nav .back::before {
  content: "";
  position: absolute;
  inset: -3.5px -4px -4.5px;
  background: url("hifi/settings-back.svg") center no-repeat;
}

#phoneSurface[data-hifi="setup"] #footer:not(:empty) { padding-bottom: 5.2301cqh; gap: 16px; }
#phoneSurface[data-hifi="setup"] #footer .button { height: 62px; }

#phoneSurface[data-hifi="setup"] .setup-step h1 {
  font-weight: 700;
  letter-spacing: 0;
  color: var(--brand-purple);
}

#phoneSurface[data-hifi="setup"] .setup-step header p {
  margin-block-start: 18px;
  color: var(--body-ink);
  font-size: 14px;
}

#phoneSurface[data-hifi="setup"] .setup-belt {
  width: min(196px, 48cqw);
  aspect-ratio: 196 / 152;
}

#phoneSurface[data-hifi="setup"] .setup-details {
  background: var(--lilac-paper);
  border-color: #f4edfb;
  border-radius: var(--glass-radius);
}

#phoneSurface[data-hifi="setup"] .setup-details .row { border-color: #f4edfb; }
#phoneSurface[data-hifi="setup"] .setup-auth h2 { color: var(--brand-ink); font-weight: 700; }
#phoneSurface[data-hifi="setup"] .setup-progress { background: var(--brand-purple); }

#phoneSurface[data-hifi="setup"] .setup-hint {
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--soft-white);
  color: var(--body-ink);
}

#phoneSurface[data-hifi="setup"] .setup-review-time input {
  width: 112px;
  min-height: 44px;
  border-color: #f4edfb;
  border-radius: 12px;
  background: #fff;
  color: var(--body-ink);
  font: 13px Inter, system-ui, sans-serif;
}

#phoneSurface[data-hifi="setup"] .setup-review-time input:disabled { color: var(--subdued-text); }

#phoneSurface[data-hifi="setup"] .switch {
  padding: 0;
  border: 0;
  background: url("hifi/settings-switch-off.svg") center no-repeat;
}

#phoneSurface[data-hifi="setup"] .switch.on { background-image: url("hifi/settings-switch-on.svg"); }
#phoneSurface[data-hifi="setup"] .switch::after { content: none; }

#phoneSurface[data-hifi="setup"] #screen[data-view="consent"] .setup-step header {
  padding-top: clamp(16px, calc(17.7824cqh - 131px), 39px);
}

#phoneSurface[data-hifi="setup"] #screen[data-view="consent"] .setup-step h1 {
  font-size: clamp(28px, 7.727cqw, 34px);
  line-height: 54px;
}

#phoneSurface[data-hifi="setup"] #screen[data-view="consent"] .setup-step header p {
  display: grid;
  place-items: center;
  max-width: 350px;
  min-height: 35px;
  margin: 13px auto 0;
  color: #949494;
  line-height: 20.3px;
}

#phoneSurface[data-hifi="setup"] #screen[data-view="consent"] .setup-body {
  padding-block-start: clamp(32px, 10.669cqh, 102px);
}

#phoneSurface[data-hifi="setup"] .setup-preferences {
  padding: 9px 15px 13px;
  color: var(--body-ink);
}

#phoneSurface[data-hifi="setup"] .setup-preferences .row {
  padding: 0;
  min-height: 52px;
  border-bottom: 0;
}

#phoneSurface[data-hifi] .row .control-label {
  color: var(--body-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 23px;
}

#phoneSurface[data-hifi] .row .control-label small {
  margin: 0;
  color: #949494;
  font-size: 12px;
  font-weight: 400;
  line-height: 17.4px;
}

#phoneSurface[data-hifi="setup"] .setup-preferences .setup-review-time {
  min-height: 44px;
  margin-top: 8px;
  font-size: 12px;
}

#phoneSurface[data-hifi="setup"] .setup-preferences .setup-review-time input { margin-inline-end: 1px; }

#phoneSurface[data-hifi="setup"] .setup-preferences .row:last-child {
  min-height: 0;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid #f4edfb;
}

/* Cards and controls shared by the conversation and its history. */
#phoneSurface[data-hifi] #screen .story-message :is(.weekly-card, .card, .growth-proposal) {
  color: var(--body-ink);
  background: var(--soft-white);
  border: 1px solid #fff;
  border-radius: var(--glass-radius);
}

#phoneSurface[data-hifi] #screen .story-message :is(.weekly-card, .card, .growth-proposal) h3 {
  color: var(--brand-ink);
  font-weight: 650;
}

#phoneSurface[data-hifi] #screen .story-message .caption { color: var(--subdued-text); }

#phoneSurface[data-hifi] #screen .date-rule:not(:first-child) { margin-top: 22px; }

#phoneSurface[data-hifi] #screen .weekly-card .chart-bars {
  height: 162px;
  margin: 12px 0;
  padding: 12px 8px 27px;
  background: var(--lilac-paper);
  border: 1px solid var(--lavender-line);
  border-radius: var(--glass-radius);
}

#phoneSurface[data-hifi] #screen .weekly-card .bar-wrap .bar {
  background: linear-gradient(#9865ec, #b89aea) !important;
  border-radius: 5px 5px 2px 2px;
}

#phoneSurface[data-hifi] #screen .weekly-card .bar-wrap small { bottom: -20px; }

#phoneSurface[data-hifi] #screen .weekly-card .segmented {
  padding: 3px;
  background: var(--lavender);
  border-color: var(--lavender-line);
}

#phoneSurface[data-hifi] #screen .weekly-card .segmented button {
  min-height: 36px;
  color: var(--brand-ink);
}

#phoneSurface[data-hifi] #screen .weekly-card .segmented button[aria-pressed="true"] {
  background: #fff;
  box-shadow: var(--surface-shadow);
  font-weight: 650;
}

#phoneSurface[data-hifi] #screen .story-message .actions button,
#phoneSurface[data-hifi] #screen .source-link,
#phoneSurface[data-hifi] #screen :is(.archive-row, .connect-device-card > button[data-action]) {
  border: 1px solid var(--lavender-line);
  border-radius: var(--glass-radius);
  background: var(--lilac-paper);
  color: var(--brand-ink);
}

#phoneSurface[data-hifi] #screen .story-message .actions button { border-radius: 999px; }
#phoneSurface[data-hifi] #screen .source-link:hover { background: var(--lavender); }

#phoneSurface[data-hifi] #screen .urgent-card {
  background: var(--rose-paper);
  border: 1px solid #efd8df;
  border-radius: var(--glass-radius);
}

#phoneSurface[data-hifi] #screen .urgent-card h3 { color: var(--rose-ink); font-weight: 700; }

#phoneSurface[data-hifi] #screen .urgent-card .actions button[data-action="contactHelp"] {
  background: var(--rose-ink);
  border-color: var(--rose-ink);
  color: white;
}

/* The drawer has a continuous white surface under the status bar. */
#phoneSurface[data-hifi="history"] .history-panel {
  gap: 10px;
  padding-inline: 16px;
  padding-bottom: 24px;
}

#phoneSurface[data-hifi="history"] .history-filter {
  border-color: var(--lavender-line);
  background: var(--lilac-paper);
  color: var(--brand-ink);
}

#phoneSurface[data-hifi="history"] .history-filter:focus-within { border-color: var(--brand-purple); }
#phoneSurface[data-hifi="history"] .history-filter input:focus-visible { outline: none; }

#phoneSurface[data-hifi="history"] #historyResults section:first-child { border-bottom-color: var(--lavender-line); }
#phoneSurface[data-hifi="history"] :is(.history-heading h2, .history-pin, .history-manage) { color: var(--brand-ink); }

#phoneSurface[data-hifi="history"] .history-entry {
  padding: 0 12px;
  border: 1px solid #eee8f5;
  border-radius: var(--glass-radius);
  background: var(--lilac-paper);
  margin-bottom: 6px;
}

#phoneSurface[data-hifi="history"] .history-dismiss { background: rgb(48 35 68 / 15%); }
#phoneSurface[data-hifi="historyDetail"] #screen > :is(.caption, h2) { color: var(--brand-ink); }

/* Account and pregnancy contact artboards share the same phone chrome. */
#phoneSurface[data-hifi="account"] {
  --statusbar-height: 74px;
  border-radius: 32px;
  background-image: url("hifi/account-background.svg");
}

#phoneSurface[data-hifi="account"] #nav {
  height: 41px;
  padding-inline: var(--page-gutter);
}

#phoneSurface[data-hifi="account"]:has(#screen[data-view="my"]) #nav { padding-left: 23px; }
#phoneSurface[data-hifi="account"] .nav:has(.back) > :last-child { flex-basis: 34px; }
#phoneSurface[data-hifi="account"] .nav-center strong {
  color: #383939;
  font-size: 20px;
  font-weight: 700;
  line-height: 29px;
}

#phoneSurface[data-hifi="account"] #screen[data-view="my"] { padding-top: 18px; padding-bottom: 35px; }
#phoneSurface[data-hifi="account"] .account-avatar {
  display: block;
  width: 108px;
  height: 108px;
  border: 0;
  object-fit: cover;
}
#phoneSurface[data-hifi="account"] .account-identity h1 {
  margin: 7px 0 0;
  color: #383939;
  font: 700 26px/37px Inter, system-ui, sans-serif;
}
#phoneSurface[data-hifi="account"] .account-identity p {
  margin: 0;
  color: var(--subdued-text);
  font: 400 14px/21px Inter, system-ui, sans-serif;
}
#phoneSurface[data-hifi="account"] .account-stats {
  width: min(349px, 100%);
  margin-block: 24px 25px;
  gap: clamp(10px, 5.68cqw, 25px);
}
#phoneSurface[data-hifi="account"] .account-stats > div {
  min-height: 86px;
  padding-block: 12px 8px;
  border-color: #f4edfb;
  border-radius: var(--glass-radius);
  background: var(--lilac-paper);
}
#phoneSurface[data-hifi="account"] .account-stats :is(h2, p) { color: var(--body-ink); }
#phoneSurface[data-hifi="account"] .account-stats p:first-of-type { font-size: 12px; }
.account-connection { display: flex; justify-content: center; align-items: center; gap: 9px; }
.account-offline { width: 8px; height: 8px; border-radius: 50%; background: #db4758; }

#phoneSurface[data-hifi="account"] .account-group {
  padding: 0;
  margin-bottom: 16px;
  border: 0;
  border-radius: var(--glass-radius);
  background: var(--soft-white);
  box-shadow: inset 0 0 0 1px #fff;
}
#phoneSurface[data-hifi="account"] .account-group:last-child { margin-bottom: 0; }
#phoneSurface[data-hifi="account"] .account-group button {
  position: relative;
  padding-inline: 24px 19px;
  color: var(--body-ink);
  font-size: 16px;
  border: 0;
}
#phoneSurface[data-hifi="account"] .account-group button + button::before {
  content: "";
  position: absolute;
  inset: 0 24px auto;
  border-top: 1px solid #eee;
}
.account-next { display: block; flex: none; }

#phoneSurface[data-hifi="account"] #screen[data-view="profile"] { padding-top: 25px; }
#phoneSurface[data-hifi="account"] #screen[data-view="profile"] .form-field {
  margin-bottom: 14px;
  color: var(--body-ink);
  font-size: 14px;
  text-indent: 14px;
}
#phoneSurface[data-hifi="account"] #screen[data-view="profile"] .form-field input {
  height: 44px;
  margin-top: 6px;
  padding-inline: 13px 20px;
  border-color: #e3e3e3;
  border-radius: var(--glass-radius);
  font: 400 16px/23px Inter, system-ui, sans-serif;
  text-indent: 0;
}
#phoneSurface[data-hifi="account"] #profileDue::-webkit-calendar-picker-indicator {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  background: url("hifi/contact-calendar.svg") center no-repeat;
}
#phoneSurface[data-hifi="account"] #screen[data-view="profile"] .button:not(.secondary) {
  height: 48px;
  background: #9263eb;
  border-color: transparent;
  border-radius: 30px;
  font-size: 20px;
}

/* In-flow sheets, confirmations and simulated system notifications. */
#phoneSurface[data-hifi] #overlay .modal-layer { background: rgb(48 35 68 / 36%); }

#phoneSurface[data-hifi] #overlay .dialog {
  padding: 20px 18px 16px;
  border: 1px solid rgb(255 255 255 / 85%);
  border-radius: 20px;
  background: #fffdfd;
  box-shadow: 0 12px 36px rgb(40 23 63 / 18%);
}

#phoneSurface[data-hifi] #overlay .story-dialog { padding: 14px; }
#phoneSurface[data-hifi] #overlay .dialog h2 { color: #38323e; }
#phoneSurface[data-hifi] #overlay .dialog .caption { color: var(--brand-ink); letter-spacing: .04em; }
#phoneSurface[data-hifi] #overlay .dialog p { color: var(--body-ink); }
#overlay .contact-dial { text-decoration: none; }

#phoneSurface[data-hifi] :is(#screen, #overlay) .button:not(.secondary) {
  background: var(--brand-purple);
  border-color: transparent;
  border-radius: 24px;
  color: #fff;
}

#phoneSurface[data-hifi] :is(#screen, #overlay) .button.secondary {
  background: var(--lilac-paper);
  border-color: var(--lavender-line);
  border-radius: 24px;
  color: var(--brand-ink);
}

#phoneSurface[data-hifi] #overlay .dialog :is(.form-field input, .form-field select) {
  background: var(--lilac-paper);
  border-color: var(--lavender-line);
}

#phoneSurface[data-hifi] #overlay .dialog .form-field input[type="time"] {
  border-radius: 12px;
  border-color: #f4edfb;
  background-color: #fff;
}

@supports selector(input::-webkit-calendar-picker-indicator) {
  #phoneSurface[data-hifi] :is(.setup-review-time, #overlay .form-field) input[type="time"] {
    background-image: url("hifi/settings-time.svg");
    background-repeat: no-repeat;
    background-position: right 12px center;
  }

  #phoneSurface[data-hifi] :is(.setup-review-time, #overlay .form-field) input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0;
  }
}

#phoneSurface[data-hifi] #overlay .dialog :is(.card, .notice) {
  border-color: var(--lavender-line);
  background: var(--lilac-paper);
  color: var(--body-ink);
}

#phoneSurface[data-hifi] #overlay .dialog .v2-table :is(th, td) { border-color: var(--lavender-line); }

#phoneSurface[data-hifi] #overlay .dialog[data-kind="notification"] {
  background: linear-gradient(145deg, #f6f0fd, #fff 70%);
}

#phoneSurface[data-hifi] #overlay .dialog[data-console-review]:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}

.notification-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--lavender, #f1eaf9);
}

#awaySurface {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 82px 22px 29px;
  color: #faf7ff;
  background:
    radial-gradient(ellipse 72% 32% at 66% 56%, #393146 0%, transparent 94%),
    radial-gradient(ellipse 73% 35% at 16% 64%, #262741 0%, transparent 95%),
    linear-gradient(165deg, #111018 8%, #181620 56%, #100e16);
}

#phoneSurface:has(#awaySurface) .statusbar {
  position: relative;
  z-index: 11;
  color: #faf7ff;
  background: transparent;
  pointer-events: none;
}

#phoneSurface:has(#awaySurface) .homebar {
  z-index: 11;
  background: #faf7ff;
  opacity: 1;
}

.phone-home-grid, .phone-home-dock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 8px;
}

.phone-home-grid {
  align-content: start;
  row-gap: 15px;
}

.phone-home-dock {
  margin-inline: -8px;
  padding: 12px 7px;
  border: 1px solid #fff3;
  border-radius: 32px;
  background: #a79cbe30;
  backdrop-filter: blur(16px);
}

.phone-home-app {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: 500 12px/16px system-ui, sans-serif;
  text-shadow: 0 1px 4px #221c39b3;
  white-space: nowrap;
}

.phone-home-dock .phone-home-app { gap: 0; }
.phone-home-app:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.phone-home-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid #fff7;
  border-radius: 15px;
  box-shadow: 0 3px 8px #221c393b;
  background: linear-gradient(150deg, var(--app-light, #fbf9ff), var(--app-dark, #e8e1ee));
  color: var(--app-ink, #4a4355);
}

.phone-home-icon svg { width: 36px; height: 36px; }
.phone-home-icon[data-tone="calendar"] svg { width: 52px; height: 52px; }
.phone-home-icon[data-tone="metal"] { --app-light: #e5e5eb; --app-dark: #aeaab9; --app-ink: #454252; }
.phone-home-icon[data-tone="charcoal"] { --app-light: #53505e; --app-dark: #292733; --app-ink: #faf9fd; }
.phone-home-icon[data-tone="sky"] { --app-light: #68b8e9; --app-dark: #3f77c5; --app-ink: #fff; }
.phone-home-icon[data-tone="park"] { --app-light: #c4e1c8; --app-dark: #85c0b2; }
.phone-home-icon[data-tone="green"] { --app-light: #75d5a1; --app-dark: #319971; --app-ink: #fff; }
.phone-home-icon[data-tone="mint"] { --app-light: #72e0ad; --app-dark: #20966f; --app-ink: #fff; }
.phone-home-icon[data-tone="music"] { --app-light: #f388a6; --app-dark: #cc4f70; --app-ink: #fff; }
.phone-home-brand { display: block; object-fit: contain; background: transparent; border: 0; }
button.phone-home-app:hover .phone-home-icon { filter: brightness(1.05); }
button.phone-home-app:active .phone-home-icon { transform: scale(.96); }

#phoneSurface[data-hifi] .toast { background: #51367e; }

@container (max-width: 380px) {
  #phoneSurface[data-hifi] .intro-actions { margin-top: 32px; }
  #phoneSurface[data-hifi] #footer:has(.composer) { padding-bottom: 24px; }
  #phoneSurface[data-hifi] .story-followups { column-gap: 8px; }
  #phoneSurface[data-hifi="setup"] #footer:not(:empty) { padding-bottom: 30px; }
  #phoneSurface[data-hifi="setup"] #footer .button { height: 50px; font-size: 17px; }
}
