html, body { height: 100%; background: #103843; }
body { font-family: system-ui, -apple-system, sans-serif; }
.app {
  --inset-x: clamp(16px, 5.2vw, 35px);
  max-width: 710px;
  height: 100vh;
  height: 100dvh;
  min-height: 500px;
  min-height: min(100dvh, 500px);
  isolation: isolate;
  color: #f6f9e9;
  background: #1a6676;
}
.app .screen::after {
  background: linear-gradient(180deg, #0a3449b9, #124b5f33 25%, transparent 43%, #0c364c26 57%, #09283be8 99%);
}
.studio-header {
  top: calc(env(safe-area-inset-top) + 15px);
  left: var(--inset-x);
  right: var(--inset-x);
  z-index: 5;
}
.studio-header .wordmark {
  font: 400 clamp(27px, 6vw, 40px)/1.15 Georgia, 'Yu Mincho', serif;
  color: #fff9e9;
  letter-spacing: -.055em;
  text-shadow: 0 2px 14px #082d36;
}
.studio-header #settings { min-width: 44px; min-height: 44px; border-radius: 50%; }
.studio-presence {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 72px);
  left: var(--inset-x);
  right: var(--inset-x);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 8px;
}
.glass, .app #noiseHud {
  min-height: 44px;
  padding: 6px 12px;
  color: #f7fbe9;
  background: #123d4dda;
  border: 1px solid #d3ead16b;
  border-radius: 24px;
  font-size: 12px;
  line-height: 1.15;
  box-shadow: 0 4px 15px #082e3d2b;
}
.studio-presence #noiseHud {
  position: static;
  margin: 0;
  max-width: 100%;
  text-align: left;
}
#noiseHud::before {
  display: inline-block;
  content: '';
  margin-right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b8eed0;
  vertical-align: .12em;
}
#noiseHud[data-mode="disabled"]::before { background: #8ca3a3; }
.app #noiseHud.is-loud { background: #654c36ed; }
#noiseHud.is-loud::before { background: #fbd29a; }
#quickCharacter span { color: #b8e4cd; font-size: 17px; margin-left: 4px; }
.stage-zone { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.orbit {
  position: absolute;
  top: 47%;
  left: 50%;
  width: min(80%, 490px);
  height: min(39%, 355px);
  transform: translate(-50%, -50%);
}
.orbit-line { position: absolute; inset: 0; border: 1px solid #e8ffde65; border-radius: 50%; }
.app #actions { display: block !important; position: absolute; inset: 0; }
#actions button {
  position: absolute;
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 59px;
  min-height: 55px;
  padding: 5px 7px;
  transform: translate(-50%, -50%);
  background: #143f4add;
  border: 1px solid #e2f4da99;
  border-radius: 19px;
  color: #f5f8e7;
  font-size: 11px;
  font-weight: 560;
  line-height: 1.15;
  pointer-events: auto;
  box-shadow: 0 5px 20px #08314245;
  white-space: nowrap;
}
#actions button:active { background: #38766e; }
#actions button[data-action="play"] { background: #e5f0d4; color: #224d48; border-color: #eaffd9; }
#actions svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
#actions [data-action="feed"] { left: 20%; top: 10%; }
#actions [data-action="play"] { left: 80%; top: 10%; }
#actions [data-action="clean"] { left: 1%; top: 50%; }
#actions [data-action="sleep"] { left: 99%; top: 50%; }
#actions [data-action="rest"] { left: 20%; top: 90%; }
#actions [data-action="stats"] { left: 80%; top: 90%; }
.app #pet {
  z-index: 2;
  top: 23%;
  left: 26%;
  width: 48%;
  height: 54%;
  min-width: 44px;
  min-height: 44px;
  pointer-events: auto;
}
.companion {
  position: absolute;
  width: 90%;
  top: 69%;
  left: 5%;
  text-align: center;
  text-shadow: 0 2px 12px #072d3a, 0 0 16px #072d3a;
}
#quickName {
  max-width: 95%;
  min-height: 36px;
  padding: 0 10px;
  font: 400 clamp(25px, 6vw, 38px)/1.15 Georgia, 'Yu Mincho', serif;
  letter-spacing: -.035em;
  pointer-events: auto;
}
#petName { overflow-wrap: anywhere; }
.edit-mark { font: 400 13px system-ui; color: #daeecf; vertical-align: 4px; }
#speech { color: #f0f6e6; font-size: 12px; line-height: 1.25; padding: 3px 5px; }
.studio-bottom {
  position: absolute;
  z-index: 4;
  bottom: calc(env(safe-area-inset-bottom) + 5px);
  left: var(--inset-x);
  right: var(--inset-x);
  display: grid;
  justify-items: center;
}
.studio-dock {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  width: 100%;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: #153d49eb;
  border: 1px solid #d7edde6a;
  border-radius: 23px;
  box-shadow: 0 8px 25px #051e3364;
}
.studio-dock button { min-height: 44px; }
#musicPlay, #waterPlay { border: 1px solid #cee9d583; border-radius: 50%; }
#musicPlay { background: #e5efda; color: #204942; font-size: 21px; }
#musicLibrary { text-align: left; min-width: 0; }
#musicLibrary small { display: block; font-size: 8px; letter-spacing: .15em; color: #d0e1cf; margin-bottom: 3px; }
#musicLibrary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 520; }
#waterPlay[aria-pressed="true"] { background: #dbeee0; color: #1f554c; }
#waterPlay svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-linecap: round; vertical-align: middle; stroke-width: 1.5; }
.studio-links { display: flex; justify-content: center; gap: 14px; }
.studio-links button { min-height: 36px; font-size: 11px; padding: 1px 9px; color: #f0f6ea; }
.company-credit { font-size: 9px; color: #c0d8d3; letter-spacing: .12em; }
.breath {
  position: absolute;
  left: var(--inset-x);
  right: var(--inset-x);
  top: 47%;
  transform: translateY(-50%);
  z-index: 5;
  display: grid;
  justify-items: center;
  text-align: center;
}
.breath-orb {
  width: min(57vw, 220px, 29vh);
  aspect-ratio: 1;
  border: 1px solid #f4ffdfbb;
  border-radius: 50%;
  box-shadow: 0 0 52px #e2ffe747, inset 0 0 38px #d7f2cf42;
  transition: transform 6s ease-in-out !important;
  transform: scale(.79);
}
.breath[data-phase="in"] .breath-orb { transform: scale(1.09); transition-duration: 4s !important; }
#breathCue { font-size: 16px; padding: 5px 12px; margin: 8px 0 4px; background: #103946e8; border-radius: 18px; }
#endBreath { pointer-events: auto; }
.app.in-session .orbit, .app.in-session .companion { visibility: hidden; }
#panel { max-height: 88vh; max-height: 88dvh; }
#panel .note, #panel .danger-free { color: #49655d; }
.friend-lock { color: #4b6c63; font-size: 10px; }
.character-card.locked { opacity: 1; }
.character-card.locked canvas { opacity: .64; }
.character-card > b { top: 7px; right: 7px; }
.panel-options { margin: 14px 0; }
.panel-options button { margin-top: 6px; }
.noise-result { margin: 15px 0 7px; font-weight: 650; }
#monitorPreference { display: flex; align-items: center; gap: 7px; margin-top: 13px; min-height: 34px; }
#toast { bottom: calc(env(safe-area-inset-bottom) + 108px); }
@media (max-height: 625px) {
  .orbit { top: 46.5%; height: 35%; }
  .companion { top: 66%; }
  .studio-header { top: calc(env(safe-area-inset-top) + 8px); }
  .studio-presence { top: calc(env(safe-area-inset-top) + 57px); }
  #quickName { min-height: 30px; font-size: 24px; }
  .studio-links button { min-height: 27px; }
}
@media (max-width: 350px) {
  .orbit { width: 76%; }
  #actions button { min-width: 50px; }
  .glass, .app #noiseHud { padding-inline: 8px; font-size: 11px; }
}
@media (orientation: landscape) and (min-width: 650px) and (max-height: 600px) {
  .app { max-width: none; }
  .orbit { top: 48%; width: 39%; height: 64%; }
  .companion { left: 3%; top: auto; bottom: 11%; width: 29%; }
  .studio-bottom { left: auto; width: 28%; }
  .studio-presence { right: auto; flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .breath .breath-orb { transition: none !important; transform: none !important; }
}

#panel { z-index: 8; }
#panel:not([open]) { display: none; }
#panelShade { position: fixed; inset: 0; z-index: 7; background: #102b3d99; }
.friend-lock { font-size: 11px; }

.scene { background: #168b99 url('art/lagoon.png') center / cover; }
.scene::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.screen[data-habitat="garden"] .scene::before { background: #36664625; }
.screen.sleeping .scene::before, .screen[data-habitat="moon"] .scene::before { background: #10295399; }
.scene canvas { position: relative; }

/* The companion is the entry point for its care controls. */
.app { --companion-center: 43%; }
.studio-header .wordmark { cursor: default; }
.header-buttons { display: flex; gap: 7px; align-items: center; }
.header-buttons button {
  display: grid; place-items: center; min-width: 44px; min-height: 44px;
  padding: 0; border-radius: 50%;
}
.header-buttons svg, .home-choice svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.studio-presence { align-items: start; }
.ambient-buttons { display: grid; justify-items: end; gap: 5px; }
#ambientToggle {
  min-height: 48px; padding-inline: 14px; font-size: 13px; font-weight: 650;
  border-color: #e5f4d4ad; background: #164454f5;
}
#ambientToggle[aria-pressed="false"] { background: #e2eed9; color: #1c4744; }
.orbit { top: var(--companion-center); width: min(76%, 460px); height: min(33%, 315px); }
.app #actions[hidden] { display: none !important; }
#actions [data-action="pet"] { left: 50%; top: 89%; }
.companion { top: 61.6%; }
#quickName { min-height: 44px; }
.breath { top: var(--companion-center); }
.studio-bottom { align-items: center; width: auto; gap: 9px; top: 72%; bottom: auto; }
#talk { min-height: 44px; min-width: 112px; background: #e4efd9; border-color: #f1f6dd; color: #214941; font-weight: 650; }
.studio-choices { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 8px; }
.home-choice {
  min-width: 0; min-height: 55px; border-radius: 17px; border: 1px solid #d2eada90;
  background: #153d49ef; display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; color: #f7fbee; text-align: left;
}
.home-choice svg { flex-shrink: 0; color: #bde5d3; }
.home-choice > span { min-width: 0; }
.home-choice > span > span { display: block; font-size: 12px; font-weight: 650; }
.home-choice small { display: block; margin-top: 3px; font-size: 11px; color: #d5e8dc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-links { gap: 8px; align-items: center; }
.studio-links button, .studio-links a {
  min-height: 36px; min-width: 44px; display: grid; place-items: center;
  padding: 3px 13px; border: 1px solid #d7edda6b; border-radius: 19px;
  font-size: 13px; text-decoration: none; color: #f5fbeb; background: #123e4c;
}
.studio-links #musicPlay { color: #204942; background: #e5efda; font-size: 19px; }
.studio-links #waterPlay svg { width: 19px; height: 19px; }
@media (max-height: 675px) {
  .app { --companion-center: 44%; }
  .ambient-buttons { grid-auto-flow: column; grid-template-columns: auto auto; align-items: center; }
  .studio-presence { gap: 3px; }
  #ambientToggle, .studio-presence #noiseHud { min-height: 44px; padding-inline: 7px; font-size: 10px; }
  #quickCharacter { font-size: 10px; padding-inline: 6px; }
  #quickCharacter span { display: none; }
  .orbit { height: 31%; }
  #actions button { min-width: 48px; min-height: 44px; border-radius: 14px; }
  #actions svg { width: 17px; height: 17px; }
  .companion { top: 61.9%; }
  #quickName { min-height: 33px; }
  #speech { font-size: 11px; margin-top: 0; }
  .studio-bottom { gap: 6px; top: 74%; }
  #talk { min-height: 38px; }
  .home-choice { min-height: 45px; padding-block: 4px; }
  .studio-links button, .studio-links a { min-height: 32px; }
}
@media (orientation: landscape) and (min-width: 650px) and (max-height: 600px) {
  .app { --companion-center: 48%; }
  .orbit { width: 37%; height: 59%; }
  .companion { top: auto; }
  .studio-bottom { width: min(29%, 245px); top: auto; bottom: 7%; }
  .studio-links { justify-content: center; flex-wrap: wrap; }
  .studio-choices { grid-template-columns: 1fr; }
}
@media (max-width: 359px) {
  .home-choice { gap: 5px; padding-inline: 6px; }
  #talk { min-width: 101px; padding-inline: 8px; }
  .studio-links { gap: 5px; }
  .home-choice svg { width: 17px; }
}

.personal-sheet h3 { font-weight: 650; margin: 13px 0 7px; font-size: 15px; }
.personal-sheet input:not([type="checkbox"]) { box-sizing: border-box; font-size: 16px; }
.check-in { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
.check-in label { line-height: 1.3; }
.check-in select { margin: 5px 0 10px; width: 100%; min-height: 43px; font-size: 13px; padding: 5px 3px; }
.personal-actions { display: flex; align-items: center; gap: 8px; }
.personal-actions .primary { flex: 1; }
.personal-health { border-top: 1px solid #d3e0d2; padding-top: 3px; }
#healthValues { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 13px; }
#healthValues dd { margin: 0; font-weight: 600; }
.talk-log { list-style: none; padding: 0; max-height: min(41vh, 330px); overflow: auto; overscroll-behavior: contain; }
.talk-log li { padding: 8px 10px; border-radius: 15px; margin: 7px 0 9px; max-width: 86%; overflow-wrap: anywhere; }
.talk-log li small { display: block; font-size: 10px; color: #456157; }
.talk-log li p { font-size: 14px; line-height: 1.45; margin: 4px 0 0; }
.mola-message { background: #e2edda; }
.your-message { margin-left: auto !important; background: #d4e7e3; }
.talk-form { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; }
.talk-form input { min-width: 0; }

#musicLibrary.home-choice small { font-size: 11px; letter-spacing: normal; margin-bottom: 0; }

.studio-links #talk { min-height: 42px; color: #214941; background: #e4efd9; }

/* Large library cards and the home playback strip. */
.app .screen::after { background: linear-gradient(180deg,#0b3347c4,#10425416 28%,transparent 43%,#103e5680 56%,#09283bee 100%); }
.app { --companion-center: 37%; }
.orbit { height: min(27%, 275px); }
.companion { top: 53%; }
.studio-bottom { top: 64%; gap: 10px; }
.studio-choices { gap: 9px; }
.home-choice {
  min-height: 80px; padding: 8px; border-radius: 19px; gap: 8px;
  background: linear-gradient(155deg,#286675ed,#153b4cf7);
  box-shadow: 0 8px 21px #092b3f38;
}
.home-choice > span > span { font-size: 13px; letter-spacing: -.015em; }
.home-choice small, #musicLibrary.home-choice small { font-size: 11px; margin-top: 4px; }
.choice-art { width: 42px; height: 52px; border-radius: 12px; flex: 0 0 42px; overflow: hidden; border: 1px solid #ebf6d965; }
.place-art { background: linear-gradient(160deg,#c6f4d252,transparent 54%),url('art/lagoon.png') 54% 17% / 150px auto; }
.record-art { background: radial-gradient(circle at 50% 49%, #eddca9 0 7%,#285f5b 8% 16%, #83ad93 17% 21%, #326661 22% 34%, #76a595 35% 38%, #295563 40% 50%, #294e56 52% 55%, #65a19a 57% 100%); }
.choice-chevron { margin-left: auto; font-size: 21px; font-weight: 350; color: #cde7d9; }
.playback-strip {
  display: grid; grid-template-columns: 43px 1fr 43px; gap: 11px; align-items: center;
  width: 100%; min-height: 57px; border-radius: 18px; padding: 6px 8px;
  background: #123945f5; border: 1px solid #e3f2d94f;
  box-shadow: 0 6px 20px #092c3e3b;
}
.playback-strip button { width: 43px; min-height: 43px; }
.timeline { align-self: center; min-width: 0; }
.timeline > div { display: flex; justify-content: space-between; font-size: 10px; color: #e3efe3; min-height: 17px; }
#trackTime { font-variant-numeric: tabular-nums; }
#trackProgress { appearance: none; display: block; width: 100%; height: 4px; border: 0; color: #c5e7c9; background: #4c6b72; border-radius: 5px; }
#trackProgress::-webkit-progress-bar { background: #4c6b72; border-radius: 5px; }
#trackProgress::-webkit-progress-value { background: #c5e7c9; border-radius: 5px; transition: width .3s linear; }
#trackProgress::-moz-progress-bar { background: #c5e7c9; border-radius: 5px; }
.talk-and-pixel { width: 100%; display: flex; gap: 8px; align-items: center; }
#talkLaunch {
  display: grid; grid-template-columns: 21px minmax(0,1fr) 36px; gap: 7px; align-items: center;
  flex: 1; min-width: 0; min-height: 49px; padding: 3px 5px 3px 12px;
  border-radius: 24px; background: #e2efdf; color: #224a46; border: 1px solid #f5f4d9;
  box-shadow: 0 5px 15px #07243054;
}
#talkLaunch input { min-width: 0; width: 100%; padding: 5px 0; border: 0; background: none; color: #254d48; font: 16px system-ui; }
#talkLaunch input::placeholder { color:#48695f; opacity: 1; }
#talkLaunch input:focus { outline: none; }
#talkLaunch:focus-within { outline: 2px solid #8ac8b5; outline-offset: 2px; }
#talkLaunch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
#talkSend { width: 36px; min-height: 36px; border-radius: 50%; color: #f5f9e4; background: #315f57; font-size: 18px; }
#pixelLink { display: grid; place-content: center; min-height: 44px; padding: 0 12px; color:#f2f9e5; border: 1px solid #d8efdb77; border-radius: 20px; font-size: 12px; text-decoration: none; background: #153e4eeb; }
@media (max-height: 675px) {
  .app { --companion-center: 37.8%; }
  .orbit { height: 26%; }
  .companion { top: 52.3%; }
  .studio-bottom { top: 65%; gap: 6px; }
  .home-choice { min-height: 62px; gap: 6px; }
  .choice-art { width: 31px; flex-basis: 31px; height: 41px; border-radius: 9px; }
  .playback-strip { min-height: 46px; padding-block: 3px; grid-template-columns: 37px 1fr 37px; }
  .playback-strip button { width: 37px; min-height: 37px; }
  #talkLaunch { min-height: 43px; }
  #talkSend { min-height: 32px; width: 32px; }
  #actions [data-action="pet"] { top: 86%; }
}
@media (orientation: landscape) and (min-width: 650px) and (max-height: 600px) {
  .app { --companion-center: 48%; }
  .orbit { height: 56%; }
  .companion { top: auto; }
  .studio-bottom { top: auto; bottom: 5%; }
}
@media (max-width: 359px) {
  .home-choice { padding-inline: 5px; }
  .home-choice > span > span { font-size: 11px; }
  .choice-chevron { font-size: 16px; }
  .home-choice small, #musicLibrary.home-choice small { font-size: 10px; }
}

.artist-feature {
  width: 100%; min-height: 77px; display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 12px; padding: 10px 13px; margin: 0 0 8px; border-radius: 17px;
  text-align: left; color: #fbf7e9; background: linear-gradient(120deg,#284b53,#376b60);
}
.artist-feature strong { font: 590 18px Georgia, serif; }
.artist-feature small { display: block; margin-top: 4px; font-size: 11px; color: #e0eedb; }
.artist-cover {
  width: 56px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 13px;
  background: conic-gradient(from 151deg,#174c61,#81b4a2,#e8d397,#4b797b,#153c58,#174c61);
}
.artist-cover i { width: 71%; aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle,#102d37 0 3px,#456763 4px 5px); border: 1px solid #f5f2ce82; box-shadow: 0 2px 8px #143c46a9; }
.artist-cover i::after { display: block; content: ''; width: 19%; aspect-ratio: 1; margin: 40% auto; border-radius: 50%; background: #e9cc8a; }
.hero-record { width: min(160px, 52vw); margin: 12px auto; border-radius: 23px; }
.artist-sheet .note { margin-bottom: 10px; }
.artist-sources { list-style: none; padding: 0; }
.artist-sources li { padding: 8px 0; border-bottom: 1px solid #cbddcc; }
.artist-sources li small { display: block; font-size: 11px; margin-top: 3px; }
.artist-sources a, .artist-sheet .danger-free a { color: #2b655f; }
.artist-locked a { padding: 10px 6px; color: #426b61; font-size: 11px; }
.lock-glyph { font-size: 14px; }
#talkForm input[type="search"] { border: 1px solid #b7cdbd; border-radius: 20px; background: #fffdef; padding: 10px; }
#spaceLabel { white-space: nowrap; font-size: min(12px, 3.45vw); }
#musicSearch {
  min-height: 44px; border: 1px solid #bacfbf; border-radius: 20px;
  background: #fffdf2; color: #254d45; padding: 7px 13px;
}
