/* Fonts are bundled (SIL Open Font License, see fonts/) so the app works offline. */
@font-face {
  font-family: "DM Sans";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dm-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/dm-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/dm-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/dm-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/manrope-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/manrope-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/manrope-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/manrope-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-weight: 800;
  font-display: swap;
  src: url("fonts/manrope-latin-800-normal.woff2") format("woff2");
}
:root {
  font-family: "DM Sans", sans-serif;
  color: #374439;
  background: #f5f3ec;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ac693e;
  outline-offset: 4px;
}
header {
  height: 94px;
  max-width: 1320px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 35px;
  padding: 0 50px;
  border-bottom: 1px solid #deded2;
}
.brand {
  font-size: 30px;
  letter-spacing: -2px;
  font-weight: 800;
  color: #374439;
  text-decoration: none;
}
.brand span {
  color: #c18a56;
  padding-left: 5px;
}
.tagline {
  font-size: 13px;
  color: #8a8f81;
}
header button {
  margin-left: auto;
  font-size: 13px;
  border: 1px solid #d9dccf;
  border-radius: 30px;
  padding: 10px 17px;
}
main {
  max-width: 1220px;
  padding: 40px 0 0;
  margin: auto;
}
.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #7e8978;
}
h1 {
  font-family: Manrope, sans-serif;
  font-size: 48px;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -2px;
  margin: 14px 0;
}
p {
  font-size: 14px;
  line-height: 1.65;
  color: #85907f;
  margin: 8px 0;
}
h2 {
  font-family: Manrope, sans-serif;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.8px;
  margin: 13px 0 5px;
}
.intro > div:first-child {
  position: relative;
  width: 75%;
}
.intro p {
  position: absolute;
  left: 47%;
  bottom: 0;
}
.mode {
  display: flex;
  background: #eaece3;
  border-radius: 30px;
  padding: 5px;
  font-size: 12px;
}
.mode button {
  padding: 10px 16px;
  border-radius: 25px;
}
.selected {
  background: #fff !important;
  box-shadow: 0 2px 5px #273c2410;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
  gap: 25px;
}
.scene-card {
  background: #ebece1;
  border: 1px solid #e1e3d5;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  min-height: 530px;
  display: flex;
  flex-direction: column;
}
.scene-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  font-size: 11px;
  z-index: 2;
}
.scene-heading b {
  font-weight: 500;
  color: #75806c;
}
.scene-heading i {
  display: inline-block;
  background: #869875;
  width: 6px;
  height: 6px;
  border-radius: 100%;
  margin-right: 6px;
}
.scene-heading button {
  background: #f6f6ee;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  font-size: 21px;
}
.room {
  flex: 1;
  margin: -48px 0 -25px;
}
.room svg {
  width: 100%;
  height: 465px;
  display: block;
  overflow: visible;
}
.room-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px 25px;
  z-index: 2;
}
.room-bottom strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
}
.room-bottom span {
  font-size: 11px;
  color: #89917f;
  display: block;
  margin-top: 7px;
}
.room-number {
  font-size: 9px !important;
  letter-spacing: 1.5px;
}
.card {
  border: 1px solid #e1e3d7;
  border-radius: 20px;
  background: #fafaf4;
}
.focus {
  text-align: center;
  padding: 28px 25px 23px;
}
.focus h2 {
  font-size: 23px;
  margin-top: 13px;
}
.focus p {
  font-size: 12px;
}
#timer {
  font-family: Manrope, sans-serif;
  font-size: 64px;
  font-weight: 400;
  letter-spacing: -3px;
  margin: 19px 0 15px;
  font-variant-numeric: tabular-nums;
}
#timer span {
  color: #9aa18f;
}
.durations {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 23px;
}
.durations button {
  font-size: 11px;
  border-radius: 20px;
  padding: 8px 15px;
  background: #edf0e6;
}
.primary {
  background: #52694b;
  color: #faf9ef;
  border-radius: 12px;
  padding: 15px 18px;
  width: 100%;
  font-size: 13px;
}
.primary span {
  float: right;
}
.primary:hover {
  background: #40563a;
}
.focus small {
  font-size: 10px;
  color: #939b87;
  display: block;
  margin-top: 15px;
}
.text-button {
  font-size: 11px;
  margin-top: 12px;
  text-decoration: underline;
}
.companion {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 20px 18px;
}
.avatar {
  font-size: 31px;
  color: #a78a50;
  background: #efebda;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  text-align: center;
}
.companion strong {
  font-size: 11px;
  font-weight: 500;
}
.companion p {
  font-size: 10px;
  margin: 5px 0 0;
}
.companion button {
  font-size: 25px;
  margin-left: auto;
}
.stats {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #969e8e;
  padding: 19px 8px;
}
.stats b {
  color: #586a50;
  margin-right: 4px;
}
.decorate {
  margin-top: 38px;
}
.decorate-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.decorate-title > span {
  font-size: 11px;
  color: #7c876f;
}
.items {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 23px;
}
.item {
  text-align: left;
  background: #eeeee4;
  border: 1px solid #e1e3d7;
  border-radius: 14px;
  padding: 18px;
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 14px;
  align-items: center;
}
.item strong {
  font-size: 11px;
  font-weight: 500;
}
.item small {
  font-size: 10px;
  color: #969d88;
  grid-column: 2;
}
.item.active {
  border-color: #9ca98b;
  background: #e9eddf;
}
.swatch {
  height: 30px;
  width: 46px;
  border-radius: 50%;
  transform: rotate(-25deg);
  grid-row: span 2;
  border: 3px double #ece1b7;
}
.sage {
  background: #8b9d88;
}
.rose {
  background: #bc8978;
}
.blue {
  background: #809ba2;
}
.object {
  grid-row: span 2;
  font-size: 35px;
  color: #9a805d;
  text-align: center;
}
footer {
  display: flex;
  justify-content: space-between;
  margin: 38px 0 25px;
  padding-top: 20px;
  border-top: 1px solid #deded2;
  font-size: 10px;
  color: #9da48f;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: #384b35;
  color: #fff7e7;
  border-radius: 30px;
  padding: 14px 24px;
  transition: 0.25s;
  pointer-events: none;
  z-index: 10;
  font-size: 13px;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#pet {
  cursor: pointer;
}
.pip-body {
  transform-origin: 370px 431px;
  animation: breathe 3s infinite ease-in-out;
}
.eyes {
  animation: blink 5s infinite;
}
#heart.happy {
  animation: heart 1.3s ease-out;
}
.night .scene-card {
  background: #303f46;
}
.night #walls {
  filter: brightness(0.62) saturate(0.65);
}
.night #floor {
  filter: brightness(0.7);
}
.night .room-bottom strong,
.night .scene-heading b {
  color: #d8decd;
}
.working .pip-body {
  animation: breathe 1.7s infinite;
}
.fold-view .workspace {
  grid-template-columns: 1fr;
}
.fold-view .scene-card {
  border-radius: 22px 22px 0 0;
}
.fold-view aside {
  border-top: 8px solid #384338;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
  background: #e6e8db;
  border-radius: 0 0 22px 22px;
  margin-top: -25px;
}
.fold-view .focus {
  grid-row: span 2;
}
.fold-view .stats {
  align-self: start;
}
.fold-view .companion {
  align-self: end;
}
.fold-view .room svg {
  height: 450px;
}
@keyframes breathe {
  50% {
    transform: scaleY(1.025) translateY(-1px);
  }
}
@keyframes blink {
  0%,
  43%,
  47%,
  100% {
    transform: scaleY(1);
  }
  45% {
    transform: translateY(374px) scaleY(0.06) translateY(-374px);
  }
}
@keyframes heart {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-30px);
  }
}
@media (max-width: 1250px) {
  main {
    padding: 35px 30px 0;
  }
  .item {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 10px;
  }
  .item small {
    grid-column: 1;
  }
  .swatch {
    margin: auto;
  }
  .object,
  .swatch {
    grid-row: auto;
  }
}
@media (max-width: 760px) {
  header {
    padding: 0 22px;
    height: 75px;
  }
  .tagline {
    display: none;
  }
  main {
    padding: 27px 18px 0;
  }
  .intro {
    display: block;
  }
  h1 {
    font-size: 38px;
  }
  .intro > div:first-child {
    width: 100%;
  }
  .intro p {
    position: static;
  }
  .mode {
    display: inline-flex;
    margin-top: 18px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .scene-card {
    min-height: 375px;
  }
  .room svg {
    height: auto;
  }
  .room {
    margin: -15px -12px -20px;
  }
  .scene-heading {
    padding: 17px;
  }
  .room-bottom {
    padding: 12px 20px 22px;
  }
  .focus {
    padding: 25px;
  }
  .items {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .item {
    padding: 14px 7px;
  }
  .decorate-title {
    align-items: end;
    gap: 10px;
  }
  h2 {
    font-size: 20px;
  }
  .decorate-title > span {
    white-space: nowrap;
    font-size: 10px;
  }
  .fold-view aside {
    display: block;
    margin-top: -18px;
    padding: 16px;
  }
  .fold-view .room svg {
    height: auto;
  }
  .room-number {
    display: none;
  }
  footer span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.fold-room {
  display: none !important;
}
.fold-view header,
.fold-view .intro > div:first-child,
.fold-view .decorate,
.fold-view footer,
.fold-view .room-bottom,
.fold-view .scene-heading,
.fold-view aside .companion,
.fold-view aside .stats {
  display: none;
}
.fold-view main {
  padding: 0;
  max-width: none;
}
.fold-view .intro {
  position: fixed;
  right: 18px;
  top: 12px;
  z-index: 5;
  margin: 0;
}
.fold-view .mode {
  margin: 0;
  background: #eee8d9cc;
}
.fold-view .workspace {
  display: block;
}
.fold-view .scene-card {
  height: 100dvh;
  min-height: 600px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.fold-view .room {
  margin: 0;
  position: absolute;
  inset: 0;
}
.fold-view .room > svg:first-child {
  display: none;
}
.fold-view .room .fold-room {
  display: block !important;
  width: 100%;
  height: 100%;
}
.fold-view aside {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(430px, 90%);
  padding: 0;
  border: 0;
  background: none;
  margin: 0;
  display: block;
}
.fold-view .focus {
  padding: 12px 16px;
  background: #fafaf2ed;
  box-shadow: 0 5px 25px #65503d12;
}
.fold-view .focus .eyebrow,
.fold-view .focus h2,
.fold-view .focus p,
.fold-view .focus .durations,
.fold-view .focus small {
  display: none;
}
.fold-view #timer {
  font-size: 30px;
  display: inline-block;
  width: 35%;
  margin: 0;
  vertical-align: middle;
  letter-spacing: -1px;
}
.fold-view #start {
  width: 60%;
  vertical-align: middle;
}
.fold-view #reset {
  display: block;
  margin: 8px auto 0;
}
.fold-view #reset[hidden] {
  display: none;
}
.fold-view.night .fold-room {
  filter: brightness(0.7);
}
/* Roompet's living-room edition */
.intro > div:first-child {
  width: auto;
}
.intro p {
  position: static;
}
.intro h1 {
  font-size: 42px;
}
.workspace {
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
}
.scene-card {
  min-height: 650px;
  background: radial-gradient(ellipse at 50% 35%, #f4eedc, #e3e6d8);
}
.room {
  position: relative;
  min-height: 470px;
  margin: 0;
  flex: 1;
}
.room canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  touch-action: manipulation;
  cursor: pointer;
}
.scene-heading {
  padding: 20px 25px 0;
}
.scene-heading > div {
  display: flex;
  gap: 8px;
}
.room-bottom {
  padding: 10px 25px 18px;
}
.care {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 23px 20px;
}
.care button {
  background: #fbfaf0c9;
  border: 1px solid #dce0cd;
  border-radius: 12px;
  padding: 10px 3px;
  font-size: 11px;
}
.care button:hover {
  background: #fffaf0;
  transform: translateY(-2px);
}
.care button span {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}
.pet-card {
  padding: 24px;
  margin-bottom: 16px;
}
.pet-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pet-title h2 {
  font-size: 29px;
  margin: 8px 0 0;
}
.pet-title button {
  font-size: 11px;
  border-bottom: 1px solid #b9c1a9;
  padding: 5px 0;
}
.pet-card p {
  font-size: 12px;
}
.pet-card small {
  font-size: 10px;
  color: #919a87;
}
.needs {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.needs label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #7c8974;
}
.needs meter {
  width: 65%;
  height: 9px;
  border: 0;
  background: #e6e9dd;
  border-radius: 8px;
}
.needs meter::-webkit-meter-bar {
  background: #e6e9dd;
  border: 0;
  height: 8px;
}
.needs meter::-webkit-meter-optimum-value {
  background: #96a981;
  border-radius: 8px;
}
.focus {
  padding: 22px;
}
.focus h2 {
  font-size: 19px;
}
#timer {
  font-size: 49px;
  margin: 14px 0;
}
.durations {
  margin-bottom: 15px;
}
.palette-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 11px;
}
.palette-row button {
  border: 1px solid #d9dfcd;
  border-radius: 20px;
  padding: 8px 15px;
}
.palette-row button.active {
  background: #52694b;
  color: #fff;
}
.palette-row small {
  color: #8e9984;
  margin-left: auto;
}
#bubble {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fffdf3;
  box-shadow: 0 8px 25px #594e3312;
  border-radius: 18px;
  padding: 12px 18px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
#bubble.show {
  opacity: 1;
}
dialog {
  width: min(560px, calc(100% - 28px));
  border: 1px solid #dce0cf;
  border-radius: 24px;
  padding: 30px;
  color: #374439;
  background: #faf9f1;
  max-height: 92dvh;
  overflow: auto;
  box-shadow: 0 30px 130px #1c2e3250;
}
dialog::backdrop {
  background: #30423770;
  backdrop-filter: blur(7px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-top button {
  font-size: 25px;
}
dialog h2 {
  font-size: 32px;
  margin-top: 12px;
}
dialog p {
  font-size: 13px;
}
.species {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0;
}
.species button {
  padding: 10px 5px 13px;
  border: 1px solid #dfe2d4;
  border-radius: 14px;
  background: #f0eee4;
}
.species button.selected {
  border: 2px solid #7d946b;
  padding: 9px 4px 12px;
  background: #edf1e3 !important;
}
.species svg {
  width: 82px;
  height: 82px;
  display: block;
  margin: auto;
}
.species strong {
  display: block;
  font-size: 13px;
  margin: 5px;
}
.species small {
  font-size: 10px;
  color: #8c9680;
}
.field {
  display: block;
  font-size: 12px;
}
input,
select {
  font: inherit;
  color: #374439;
  border: 1px solid #d5dbc8;
  border-radius: 9px;
  background: #fffef7;
  padding: 11px;
  width: 100%;
  margin-top: 7px;
}
.form-row {
  display: flex;
  gap: 20px;
  margin-top: 18px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  flex: 1;
  min-width: 0;
}
legend {
  font-size: 12px;
  margin-bottom: 8px;
}
#coats {
  display: flex;
  gap: 7px;
  padding-top: 8px;
}
#coats button {
  height: 27px;
  width: 27px;
  border-radius: 50%;
  border: 3px solid #faf9f1;
  outline: 1px solid #d8ddcd;
}
#coats button.selected {
  outline: 2px solid #52694b;
  background: var(--coat) !important;
}
select {
  margin: 0;
  font-size: 12px;
}
.preview-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 112px;
  margin: 10px 0;
}
.preview-strip canvas {
  width: 150px;
  height: 100px;
}
.preview-strip span {
  font-size: 12px;
  color: #80906f;
  max-width: 170px;
}
.setup-note {
  display: block;
  text-align: center;
  font-size: 10px;
  color: #939c87;
  margin-top: 13px;
}
.night .scene-card {
  background: radial-gradient(ellipse at 50% 30%, #65707b, #263c45);
}
.night .care button {
  background: #dce1d2;
}
.fold-view .scene-card {
  height: 100dvh;
  min-height: 0;
}
.fold-view .room {
  min-height: 0;
  position: absolute;
  inset: 0;
}
.fold-view .scene-heading {
  display: flex;
  padding: 15px 20px;
}
.fold-view .scene-heading > div {
  display: none;
}
.fold-view .care {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 95%);
  z-index: 4;
  padding: 0;
}
.fold-view aside {
  display: none;
}
.fold-view .intro {
  right: 12px;
  top: 7px;
}
.fold-view #bubble {
  top: 65px;
}
.fold-view .mode {
  font-size: 10px;
}
.fold-view .scene-heading b {
  font-size: 10px;
}
.fold-view .scene-heading span {
  max-width: 45%;
}
@media (max-width: 760px) {
  .intro h1 {
    font-size: 34px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .scene-card {
    min-height: 510px;
  }
  .room {
    min-height: 350px;
  }
  .scene-heading {
    padding: 18px 18px 0;
  }
  .room-bottom {
    padding: 10px 18px 15px;
  }
  .room-bottom span {
    font-size: 10px;
  }
  .care {
    padding: 0 15px 15px;
  }
  .palette-row {
    flex-wrap: wrap;
  }
  .palette-row small {
    display: none;
  }
  dialog {
    padding: 22px;
  }
  .species svg {
    width: 65px;
    height: 65px;
  }
  .form-row {
    gap: 14px;
  }
  #coats {
    gap: 5px;
  }
  #coats button {
    width: 24px;
    height: 24px;
  }
  .room-number {
    display: none;
  }
  .fold-view .scene-heading {
    padding: 20px 12px;
  }
  .fold-view .mode button {
    padding: 9px 11px;
  }
}
/* Full-screen dollhouse UI */
body {
  overflow: hidden;
  background: #e5eddf;
  color: #3f5148;
}
header {
  position: fixed;
  z-index: 5;
  top: 22px;
  left: 28px;
  right: 28px;
  border: 0;
  padding: 0;
  height: auto;
  max-width: none;
  pointer-events: none;
}
header > * {
  pointer-events: auto;
}
.brand {
  font-size: 34px;
  color: #425b4c;
  text-shadow: 0 2px #ffffff80;
}
.tagline {
  display: none;
}
header #sound {
  background: #fffdf0d9;
  border: 1px solid #fff8;
  box-shadow: 0 4px 20px #647d5910;
}
main {
  max-width: none;
  padding: 0;
}
.intro {
  position: fixed;
  left: 28px;
  top: 85px;
  z-index: 4;
  margin: 0;
  display: block;
  pointer-events: none;
}
.intro .eyebrow {
  font-size: 9px;
}
.intro h1 {
  font-size: 24px;
  letter-spacing: -1px;
  margin: 8px 0;
}
.intro p {
  font-size: 11px;
  max-width: 220px;
}
.intro .mode {
  pointer-events: auto;
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  background: #fffaf2c9;
  box-shadow: 0 4px 20px #647d5910;
}
.workspace {
  display: block;
}
.scene-card {
  position: fixed;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 0;
  height: 100dvh;
}
.room {
  position: absolute;
  inset: 0;
  min-height: 0;
  margin: 0;
}
.room canvas {
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
.scene-heading {
  position: fixed;
  left: 28px;
  bottom: 110px;
  padding: 0;
  z-index: 3;
}
.scene-heading > div {
  display: none;
}
.scene-heading b {
  font-size: 11px;
}
.room-bottom {
  position: fixed;
  bottom: 24px;
  left: 28px;
  padding: 0;
  z-index: 3;
  pointer-events: none;
}
.room-bottom .room-number {
  display: none;
}
.room-bottom strong {
  font-size: 13px;
}
.room-bottom span {
  font-size: 10px;
}
.care {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: #fffdf2d9;
  padding: 8px;
  border: 1px solid #fff9;
  border-radius: 24px;
  box-shadow: 0 8px 32px #52754c15;
  z-index: 6;
  backdrop-filter: blur(16px);
}
.care button {
  background: transparent;
  border: 0;
  min-width: 78px;
  border-radius: 17px;
  padding: 8px 10px;
  font-size: 10px;
}
.care button:hover {
  background: #e8eddc;
}
.care button span {
  font-size: 25px;
}
.workspace aside {
  position: fixed;
  top: 90px;
  right: 28px;
  width: 210px;
  z-index: 4;
  pointer-events: none;
}
.pet-card {
  background: #fffff2c7;
  border: 1px solid #fff9;
  border-radius: 20px;
  padding: 17px;
  backdrop-filter: blur(12px);
  pointer-events: auto;
  box-shadow: 0 4px 30px #758d6010;
}
.pet-title {
  gap: 8px;
}
.pet-title h2 {
  font-size: 22px;
}
.pet-title .eyebrow {
  font-size: 8px;
  letter-spacing: 1px;
}
.pet-title button {
  font-size: 10px;
}
.pet-card p {
  font-size: 10px;
}
.needs {
  gap: 8px;
  margin: 14px 0;
}
.needs label {
  font-size: 10px;
}
.pet-card > small {
  display: none;
}
.focus {
  display: none;
  position: fixed;
  right: 28px;
  bottom: 100px;
  width: 280px;
  pointer-events: auto;
  background: #fffcf3f2;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px #536a4c20;
}
.show-focus .focus {
  display: block;
}
.stats {
  justify-content: flex-end;
  padding: 0;
  gap: 10px;
}
.stats > span:first-child {
  display: none;
}
.stats > span {
  background: #fffdf0c9;
  border-radius: 18px;
  padding: 9px 13px;
  color: #687859;
}
.decor-launch,
.focus-launch {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 7;
  background: #526f50;
  color: #fff7e9;
  padding: 16px 22px;
  border-radius: 30px;
  box-shadow: 0 5px 20px #405b4425;
  font-size: 12px;
}
.focus-launch {
  right: 210px;
  background: #fffdf0;
  color: #526f50;
}
.decorate {
  display: none;
  position: fixed;
  right: 20px;
  top: 80px;
  bottom: 94px;
  z-index: 10;
  margin: 0;
  width: 320px;
  border-radius: 24px;
  background: #fffcf3f5;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 60px #40573a26;
  overflow: auto;
  padding: 22px;
}
.editing .decorate {
  display: block;
}
.editing .workspace aside {
  display: none;
}
.editing .decor-launch {
  background: #bc7d52;
}
.legacy-decor {
  display: none;
}
.drawer-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #879079;
}
.drawer-title button {
  font-size: 25px;
}
.editor-section {
  margin-top: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e7e9dc;
}
.editor-section h3 {
  font-size: 13px;
  margin: 0 0 10px;
  font-weight: 600;
}
.editor-section p {
  font-size: 10px;
}
.editor-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.editor-options button {
  border: 1px solid #dce1cf;
  border-radius: 12px;
  background: #f4f4e9;
  padding: 9px 10px;
  font-size: 11px;
}
.editor-options button.active {
  border-color: #789361;
  background: #e5ecd7;
  color: #45613c;
}
.editor-swatches button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  padding: 0;
  border: 3px solid #fff9;
}
.editor-swatches button.active {
  outline: 2px solid #63844f;
}
.furniture-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.furniture-list button {
  border: 1px solid #dce1cf;
  border-radius: 13px;
  background: #f5f2e7;
  font-size: 9px;
  padding: 10px 4px;
}
.furniture-list button span {
  display: block;
  font-size: 24px;
  margin-bottom: 5px;
  color: #8a9b72;
}
.furniture-list button.active {
  background: #e5ecd7;
  border-color: #87a06d;
}
.furniture-list button.absent {
  opacity: 0.6;
}
.selected-object {
  background: #eef0e0;
  border-radius: 15px;
  padding: 13px;
  margin-top: 14px;
}
.selected-object h4 {
  font-size: 12px;
  margin: 0 0 8px;
}
.selected-object button {
  font-size: 10px;
  background: #fffdf2;
  padding: 8px;
  border-radius: 8px;
  margin: 3px 2px;
}
.move-controls {
  display: flex;
  justify-content: center;
}
.editor-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.editor-footer button {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  background: #e8ecde;
  font-size: 11px;
}
.editor-footer .primary {
  background: #526f50;
  color: #fff;
}
.placement-tip {
  font-size: 10px !important;
  color: #7e8f71 !important;
}
footer {
  display: none;
}
#bubble {
  position: fixed;
  top: auto;
  bottom: 140px;
  left: 50%;
  z-index: 3;
  max-width: 80vw;
  white-space: normal;
  text-align: center;
  box-shadow: 0 7px 25px #65774b17;
  border: 1px solid #fff;
  border-radius: 20px;
}
#toast {
  bottom: 115px;
}
#loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #e9eee2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #61775a;
  font-size: 16px;
}
#loading[hidden] {
  display: none;
}
.fold-view .scene-card {
  height: 100dvh;
}
.fold-view .intro {
  display: block;
  position: fixed;
  top: 85px;
  left: 28px;
  right: auto;
}
.fold-view .intro .mode {
  top: 24px;
  right: auto;
  left: 50%;
}
.fold-view .scene-heading {
  top: auto;
  bottom: 110px;
  left: 28px;
  padding: 0;
}
.fold-view .care {
  bottom: 24px;
  width: auto;
  padding: 8px;
  left: 50%;
}
.fold-view .scene-heading span {
  max-width: none;
}
.fold-view .room-bottom {
  display: none;
}
.fold-view header {
  display: flex;
}
.fold-view #bubble {
  top: auto;
  bottom: 140px;
}
.fold-view .decorate {
  display: none;
}
.fold-view.editing .decorate {
  display: block;
}
.fold-view .room {
  inset: 0;
}
.fold-view .intro > div:first-child {
  display: none;
}
@media (max-width: 760px) {
  header {
    top: 16px;
    left: 18px;
    right: 18px;
  }
  .brand {
    font-size: 28px;
  }
  header #sound {
    font-size: 10px;
    padding: 9px 12px;
  }
  .intro {
    left: 18px;
    top: 72px;
  }
  .intro h1 {
    font-size: 21px;
  }
  .intro .eyebrow,
  .intro p {
    display: none;
  }
  .intro .mode,
  .fold-view .intro .mode {
    top: auto;
    bottom: 118px;
    left: 18px;
    transform: none;
    font-size: 10px;
    box-shadow: none;
  }
  .intro .mode button {
    padding: 8px 10px;
  }
  .workspace aside {
    top: 72px;
    right: 16px;
    width: 160px;
  }
  .pet-card {
    padding: 12px;
  }
  .pet-card .eyebrow,
  .pet-card p,
  .needs {
    display: none;
  }
  .pet-title h2 {
    font-size: 18px;
    margin: 0;
  }
  .pet-title button {
    font-size: 9px;
  }
  .stats {
    font-size: 9px;
  }
  .care,
  .fold-view .care {
    bottom: 18px;
    padding: 5px;
    border-radius: 20px;
    left: 18px;
    transform: none;
    gap: 0;
  }
  .care button {
    min-width: 57px;
    padding: 8px 5px;
    font-size: 9px;
  }
  .care button span {
    font-size: 22px;
  }
  .decor-launch {
    right: 16px;
    bottom: 20px;
    padding: 17px 14px;
    font-size: 10px;
    max-width: 110px;
  }
  .focus-launch {
    right: 16px;
    bottom: 81px;
    font-size: 10px;
    padding: 10px 14px;
  }
  .room-bottom {
    display: none;
  }
  .scene-heading,
  .fold-view .scene-heading {
    left: 18px;
    bottom: 91px;
  }
  .scene-heading b {
    font-size: 9px;
  }
  .decorate {
    top: 128px;
    bottom: 145px;
    right: 12px;
    width: min(305px, calc(100% - 24px));
    padding: 18px;
  }
  .editing .intro .mode {
    display: none;
  }
  .focus {
    right: 16px;
    bottom: 130px;
    width: 260px;
  }
  #bubble,
  .fold-view #bubble {
    bottom: 167px;
    font-size: 11px;
  }
  #toast {
    bottom: 160px;
    font-size: 11px;
    padding: 12px 18px;
  }
  .fold-view .intro {
    top: 72px;
    left: 18px;
  }
  .fold-view .scene-heading {
    padding: 0;
  }
  .fold-view .scene-heading span {
    max-width: none;
  }
  dialog {
    max-height: 92dvh;
  }
}
.view-tools {
  position: fixed;
  left: 28px;
  bottom: 150px;
  display: flex;
  gap: 4px;
  z-index: 5;
  background: #fffdf0c9;
  padding: 4px;
  border-radius: 22px;
}
.view-tools button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 19px;
}
.view-tools button:hover {
  background: #e4ebd5;
}
.fold-view .view-tools {
  display: none;
}
@media (max-width: 760px) {
  .view-tools {
    left: 18px;
    bottom: 163px;
    padding: 3px;
  }
  .view-tools button {
    width: 27px;
    height: 27px;
    font-size: 16px;
  }
}
.scene-night header .brand,
.scene-night .intro h1,
.scene-night .intro p,
.scene-night .intro .eyebrow,
.scene-night .room-bottom strong,
.scene-night .room-bottom span,
.scene-night .scene-heading b {
  color: #f1ebd4;
  text-shadow: none;
}
.fold-view .workspace aside {
  display: block;
  position: fixed;
  top: 90px;
  bottom: auto;
  left: auto;
  right: 28px;
  transform: none;
  width: 210px;
  padding: 0;
  background: none;
  border: 0;
  margin: 0;
  pointer-events: none;
}
.fold-view .pet-card,
.fold-view .stats {
  display: none;
}
.fold-view .focus {
  display: none;
}
.fold-view.show-focus .focus {
  display: block;
}
/* v4: wish, leaves feedback, shop */
.wish {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f1efdc;
  color: #5d6f4f;
  font-size: 10px !important;
  line-height: 1.35;
}
.wish:empty {
  display: none;
}
.wish span {
  color: #8aa06e;
  margin-right: 3px;
}
.wish b {
  color: #7d9c5b;
  white-space: nowrap;
}
.stats > span {
  transition: transform 0.2s;
}
.stats > span.bump {
  transform: scale(1.15);
}
.leaf-float {
  position: fixed;
  z-index: 30;
  transform: translate(-50%, 0);
  color: #5f8048;
  font-weight: 700;
  font-size: 15px;
  pointer-events: none;
  text-shadow: 0 1px 0 #fff;
  animation: leaf-float 1.5s ease-out forwards;
}
@keyframes leaf-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px) scale(0.7);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -6px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -46px) scale(1);
  }
}
.wallet {
  margin-top: 14px;
  font-size: 11px;
  color: #6c7f5c;
}
.wallet b {
  font-size: 14px;
  color: #4f6b43;
}
.price {
  font-style: normal;
  font-size: 9px;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 8px;
  background: #f3e3bd;
  color: #8a6a2c;
  white-space: nowrap;
}
.furniture-list .price {
  display: inline-block;
  margin: 4px 0 0;
}
.editor-options button.locked:not(.active),
.furniture-list button.locked:not(.active) {
  border-style: dashed;
}
.editor-swatches button {
  position: relative;
}
.editor-swatches button i {
  position: absolute;
  right: -6px;
  bottom: -6px;
  font-style: normal;
  font-size: 9px;
  background: #f3e3bd;
  color: #8a6a2c;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  line-height: 15px;
}
.preview-bar {
  position: sticky;
  top: -22px;
  z-index: 2;
  margin: 12px -6px 0;
  padding: 12px;
  border-radius: 16px;
  background: #fff6df;
  border: 1px solid #ecd9a8;
  box-shadow: 0 8px 20px #8a6a2c18;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.preview-bar > div {
  flex: 1 1 100%;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.preview-bar > div span {
  color: #8a6a2c;
  font-size: 11px;
}
.preview-bar small {
  flex: 1 1 100%;
  font-size: 10px;
  color: #8a6a2c;
}
.preview-bar button {
  flex: 1;
  padding: 9px;
  border-radius: 11px;
  font-size: 11px;
  background: #eee9d6;
}
.preview-bar button.primary {
  background: #526f50;
  color: #fff;
}
@media (max-width: 760px) {
  .workspace aside {
    width: 190px;
  }
  .pet-card .wish {
    display: block;
    margin-top: 6px;
    font-size: 9px !important;
  }
}
/* v4.2: friendship, tricks, cards, fold, phone layout */
.bond {
  margin-top: 10px;
  font-size: 10px;
  color: #6c7f5c;
}
.bond:empty {
  display: none;
}
.bond span b {
  color: #c0705a;
}
.bond i {
  display: block;
  height: 6px;
  margin-top: 5px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e39a86 var(--p), #efe6d6 var(--p));
}
#tricks-pop {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  width: min(340px, calc(100% - 24px));
  padding: 14px;
  border-radius: 20px;
  background: #fffcf3f7;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px #40573a2e;
}
#tricks-pop[hidden] {
  display: none;
}
#tricks-pop h4 {
  margin: 0 0 10px;
  font-size: 13px;
}
#tricks-pop > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
#tricks-pop button {
  border: 1px solid #dce1cf;
  border-radius: 13px;
  background: #f4f4e9;
  padding: 9px 4px;
  font-size: 10px;
  line-height: 1.25;
}
#tricks-pop button span {
  display: block;
  font-size: 18px;
  color: #c0705a;
  margin-bottom: 3px;
}
#tricks-pop button:disabled {
  opacity: 0.45;
  border-style: dashed;
}
#tricks-pop button small {
  display: block;
  color: #8a6a2c;
}
#tricks-pop p {
  margin: 10px 0 0;
  font-size: 10px;
  color: #6c7f5c;
}
.sheet {
  position: fixed;
  z-index: 25;
  left: 50%;
  top: 90px;
  width: min(360px, calc(100% - 28px));
  transform: translate(-50%, -12px);
  opacity: 0;
  transition: 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  padding: 18px 18px 14px;
  border-radius: 22px;
  background: #fffcf3;
  box-shadow: 0 20px 60px #40573a33;
}
.sheet.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.sheet .eyebrow {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #8a9a78;
}
.sheet h3 {
  margin: 8px 0 6px;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.sheet p {
  margin: 0;
  font-size: 12px;
  color: #5d6f4f;
}
.sheet-gifts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.sheet-gifts span {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #f1efdc;
  color: #5d6f4f;
}
.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.sheet-actions button {
  flex: 1;
  padding: 11px;
  border-radius: 14px;
  background: #eee9d6;
  font-size: 12px;
}
.sheet-actions button.primary {
  background: #526f50;
  color: #fff;
}
.fold-view .view-tools {
  display: none;
}
@media (max-width: 760px) {
  .care,
  .fold-view .care {
    left: 10px;
    right: 10px;
    bottom: 12px;
    justify-content: space-between;
  }
  .care button {
    flex: 1;
    min-width: 0;
    padding: 8px 2px;
  }
  .decor-launch {
    bottom: 94px;
    right: 12px;
    padding: 11px 14px;
    max-width: none;
  }
  .focus-launch {
    bottom: 94px;
    right: 140px;
    padding: 11px 14px;
  }
  .intro .mode,
  .fold-view .intro .mode {
    top: auto;
    bottom: 146px;
    left: 12px;
  }
  .view-tools {
    left: auto;
    right: 12px;
    bottom: 146px;
  }
  .scene-heading,
  .fold-view .scene-heading {
    display: none;
  }
  #bubble,
  .fold-view #bubble {
    bottom: 196px;
  }
  #toast {
    bottom: 196px;
  }
  #tricks-pop {
    bottom: 94px;
  }
  .workspace aside {
    top: 66px;
  }
  .pet-card .bond {
    margin-top: 6px;
  }
}

/* App shell: no text selection, callouts or rubber-band scrolling. */
html,
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Keyboard focus keeps its ring; taps and the dialog's initial focus don't. */
button:focus:not(:focus-visible),
#adopt [data-species]:focus {
  outline: none;
}
/* v4.3: guestbook, goals */
#book-button {
  position: relative;
  pointer-events: auto;
  background: #fffdf0c9;
  border-radius: 18px;
  padding: 9px 13px;
  color: #687859;
  font-size: inherit;
}
#book-button i {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: #d9733f;
  color: #fff;
  font:
    600 10px/17px "DM Sans",
    sans-serif;
  font-style: normal;
}
#book-button i:empty {
  display: none;
}
.stats {
  pointer-events: auto;
}
.furniture-list .season {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  color: #b0632f;
}
.book {
  position: fixed;
  z-index: 26;
  left: 50%;
  top: 70px;
  bottom: 100px;
  width: min(420px, calc(100% - 24px));
  transform: translate(-50%, 14px);
  opacity: 0;
  transition: 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: #fffcf3;
  box-shadow: 0 20px 60px #40573a38;
  padding: 16px 16px 10px;
}
.book.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.book-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.book-tabs {
  display: flex;
  gap: 4px;
  background: #f1efe2;
  border-radius: 14px;
  padding: 3px;
}
.book-tabs button {
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 12px;
  color: #6c7f5c;
}
.book-tabs button.on {
  background: #fff;
  color: #3f5148;
  box-shadow: 0 1px 4px #0001;
}
.book-close {
  font-size: 24px;
  color: #8a9a78;
}
.book-sub {
  margin: 12px 2px 10px;
  font-size: 11px;
  color: #6c7f5c;
}
.guest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  overflow: auto;
  padding-bottom: 6px;
}
.guest {
  background: #f4f3e6;
  border-radius: 16px;
  padding: 8px 6px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.guest img {
  width: 76px;
  height: 76px;
}
.guest b {
  font-size: 12px;
}
.guest span {
  font-size: 10px;
  color: #6c7f5c;
}
.guest small {
  font-size: 9px;
  color: #8a9a78;
  line-height: 1.3;
}
.guest.unknown {
  background: #efeee4;
  border: 1px dashed #d6d6c2;
}
.guest .q {
  width: 60px;
  height: 60px;
  margin: 8px 0 6px;
  border-radius: 50%;
  background: #e2e3d3;
  color: #a2a88f;
  font:
    600 26px/60px Manrope,
    sans-serif;
}
.goal-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-bottom: 6px;
}
.goal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f4f3e6;
}
.goal > div {
  flex: 1;
}
.goal b {
  font-size: 12px;
  font-weight: 600;
}
.goal small {
  display: block;
  font-size: 10px;
  color: #b0632f;
}
.goal i {
  display: block;
  height: 5px;
  margin-top: 6px;
  border-radius: 5px;
  background: linear-gradient(90deg, #8aa86b var(--p), #e3e3d2 var(--p));
}
.goal > span {
  font-size: 11px;
  color: #6c7f5c;
}
.goal button {
  padding: 8px 10px;
  border-radius: 11px;
  background: #526f50;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
}
.goal.claimed {
  opacity: 0.55;
}
@media (max-width: 760px) {
  .book {
    top: 60px;
    bottom: 90px;
  }
  .stats {
    gap: 6px;
  }
}
/* v4.4: friends and visiting */
#friends-button {
  position: relative;
  pointer-events: auto;
  background: #fffdf0c9;
  border-radius: 18px;
  padding: 9px 13px;
  color: #687859;
  font-size: inherit;
}
#friends-button i {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: #d9733f;
  color: #fff;
  font:
    600 10px/17px "DM Sans",
    sans-serif;
  font-style: normal;
}
#friends-button i:empty {
  display: none;
}
.friends-panel .fr-intro,
.friends-panel .fr-body {
  overflow: auto;
  padding: 4px 2px 8px;
}
.fr-intro h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}
.fr-intro p {
  font-size: 12px;
  color: #5d6f4f;
}
.fr-small {
  font-size: 11px !important;
  color: #7e8f71 !important;
}
.fr-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  font-size: 12px;
  color: #5d6f4f;
}
.friends-panel .primary {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  background: #526f50;
  color: #fff;
  font-size: 13px;
  margin-top: 6px;
}
.fr-code {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #f1efdc;
  text-align: center;
}
.fr-code span {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: #7e8f71;
  text-transform: uppercase;
}
.fr-code b {
  display: block;
  margin: 4px 0 8px;
  font:
    700 26px/1.2 Manrope,
    sans-serif;
  letter-spacing: 2px;
  color: #3f5148;
}
.fr-code button,
.fr-add button {
  padding: 8px 14px;
  border-radius: 11px;
  background: #fffdf2;
  font-size: 11px;
  margin: 0 3px;
}
.fr-add {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.fr-add input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dce1cf;
  background: #fffdf2;
  font:
    500 13px "DM Sans",
    sans-serif;
  text-transform: uppercase;
}
.fr-add button {
  background: #526f50;
  color: #fff;
}
.fr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.fr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f4f3e6;
}
.fr-row > div {
  flex: 1;
}
.fr-row b {
  display: block;
  font-size: 13px;
}
.fr-row span {
  font-size: 10px;
  color: #6c7f5c;
}
.fr-row button[data-visit] {
  padding: 8px 12px;
  border-radius: 11px;
  background: #526f50;
  color: #fff;
  font-size: 11px;
}
.fr-row .fr-x {
  font-size: 18px;
  color: #a2a88f;
  padding: 0 4px;
}
.fr-ok {
  color: #7d9c5b !important;
}
.fr-empty {
  font-size: 12px;
  color: #7e8f71;
  text-align: center;
  padding: 10px;
}
.fr-leave {
  display: block;
  margin: 4px auto 0;
  font-size: 11px;
  color: #b0632f;
  text-decoration: underline;
}
#visit-bar {
  position: fixed;
  z-index: 24;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 20px;
  background: #fffcf3f2;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px #40573a2e;
}
.vb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vb-head .eyebrow {
  display: block;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #8a9a78;
}
.vb-head b {
  font-size: 15px;
}
.vb-home {
  padding: 9px 13px;
  border-radius: 12px;
  background: #526f50;
  color: #fff;
  font-size: 12px;
}
.vb-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.vb-reactions button {
  padding: 7px 11px;
  border-radius: 14px;
  background: #f4e9dc;
  color: #8a4f2d;
  font-size: 11px;
}
.vb-reactions button:disabled {
  opacity: 0.5;
}
.vb-done {
  margin: 8px 0 0;
  font-size: 12px;
  color: #7d9c5b;
}
.vb-extra {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
.vb-extra button {
  font-size: 11px;
  color: #6c7f5c;
}
.vb-extra .vb-report {
  color: #b0632f;
}
.visiting .decor-launch,
.visiting .workspace aside {
  display: none;
}
.visiting .intro h1,
.visiting .intro .eyebrow,
.visiting .intro p {
  visibility: hidden;
}
@media (max-width: 760px) {
  #visit-bar {
    top: 64px;
  }
}
/* Leaves, Book and Friends sit on one row. */
.stats {
  flex-wrap: nowrap;
  gap: 6px;
}
.stats > span,
#book-button,
#friends-button {
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 11px;
}
@media (min-width: 761px) {
  .workspace aside {
    width: 236px;
  }
}
.fr-check input {
  width: auto;
  flex: none;
  margin: 0;
}
.fr-check {
  justify-content: center;
}
/* No double-tap zoom anywhere: rapid taps on buttons stay taps. */
html,
body,
button,
input,
select,
.care,
.stats {
  touch-action: manipulation;
}
/* v4.5: live strip (inside the visit bar, or floating at home when someone's over) */
#live-strip {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ece8d6;
}
#live-strip.floating {
  position: fixed;
  z-index: 23;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 20px;
  background: #fffcf3f2;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px #40573a2e;
}
.ls-who {
  font-size: 11px;
  color: #5d6f4f;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ls-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7fbf6a;
  box-shadow: 0 0 0 3px #7fbf6a33;
}
.ls-dot.off {
  background: #c8c8b8;
  box-shadow: none;
}
.ls-log {
  margin-top: 6px;
  max-height: 70px;
  overflow: auto;
}
.ls-log p {
  margin: 2px 0;
  font-size: 11px;
  color: #3f5148;
}
.ls-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.ls-actions button {
  flex: 1;
  padding: 8px;
  border-radius: 12px;
  background: #526f50;
  color: #fff;
  font-size: 11px;
}
.ls-phrases {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.ls-phrases::-webkit-scrollbar {
  display: none;
}
.ls-phrases button {
  flex: none;
  padding: 7px 11px;
  border-radius: 14px;
  background: #eef0e2;
  color: #45613c;
  font-size: 11px;
  white-space: nowrap;
}
.ls-chat {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.ls-chat input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #dce1cf;
  background: #fffdf2;
  font:
    500 13px "DM Sans",
    sans-serif;
  -webkit-user-select: text;
  user-select: text;
}
.ls-chat button {
  padding: 9px 14px;
  border-radius: 12px;
  background: #526f50;
  color: #fff;
  font-size: 12px;
}
@media (max-width: 760px) {
  #live-strip.floating {
    top: 64px;
  }
}
/* v4.6: compact live pill, see-through chat panel, invite-first Friends panel */
#visit-bar,
#live-strip.floating {
  background: rgba(255, 252, 243, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  padding: 10px 12px;
}
.vb-head {
  gap: 8px;
}
.vb-head > div {
  flex: 1;
  min-width: 0;
}
.vb-note,
.vb-home {
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}
.vb-note {
  background: #f4e9dc;
  color: #8a4f2d;
}
.vb-done {
  font-size: 11px;
  margin: 0;
  white-space: nowrap;
}
#live-strip {
  margin-top: 8px;
  padding-top: 8px;
}
#live-strip.floating {
  width: min(380px, calc(100% - 24px));
  border-radius: 18px;
}
.ls-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ls-who {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #3f5148;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ls-row button {
  padding: 7px 10px;
  border-radius: 11px;
  background: #eef0e2;
  color: #45613c;
  font-size: 12px;
}
.ls-row .ls-chat-btn {
  background: #526f50;
  color: #fff;
}
.ls-last {
  margin-top: 5px;
  font-size: 11px;
  color: #5d6f4f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#chat-sheet {
  position: fixed;
  z-index: 25;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100px;
  width: min(440px, calc(100% - 20px));
  max-height: 34dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(255, 252, 243, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 34px #40573a26;
}
.cs-log {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.cs-log p {
  margin: 2px 0;
  font-size: 12px;
  color: #3f5148;
}
.cs-empty,
.cs-note {
  font-size: 11px !important;
  color: #7e8f71 !important;
  margin: 4px 0 0;
}
#chat-sheet .ls-phrases button {
  background: rgba(238, 240, 226, 0.9);
}
/* Folded foldable: the room on the upper screen, chat on the lower one. */
.folded #chat-sheet {
  top: 50%;
  bottom: 0;
  max-height: none;
  width: 100%;
  border-radius: 0;
  transform: none;
  left: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.folded #live-strip.floating,
.folded #visit-bar {
  top: 12px;
}
.fr-invite {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #f1efdc;
  text-align: center;
}
.fr-invite b {
  display: block;
  font-size: 16px;
}
.fr-invite span {
  display: block;
  font-size: 12px;
  color: #5d6f4f;
  margin: 4px 0 6px;
}
.fr-link {
  display: block;
  margin: 8px auto 0;
  font-size: 12px;
  color: #526f50;
  text-decoration: underline;
}
.secondary-wide {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: #eee9d6;
  font-size: 13px;
  margin: 4px 0 8px;
}
.fr-more {
  margin-top: 6px;
  font-size: 12px;
  color: #6c7f5c;
}
.fr-more summary {
  cursor: pointer;
  padding: 6px 0;
}
.fr-online {
  font-style: normal;
  color: #5f9b4c;
  font-weight: 600;
}
@media (max-width: 760px) {
  .live-on .workspace aside .pet-card {
    display: none;
  }
  .live-on .workspace aside {
    top: 128px;
  }
}
/* v4.7: decorating drawer */
#min-decor {
  font-size: 20px;
  color: #8a9a78;
  margin-left: auto;
  margin-right: 10px;
}
.drawer-title {
  gap: 4px;
}
.decorate {
  background: rgba(255, 252, 243, 0.86);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.drawer-min .decorate > :not(.drawer-title) {
  display: none;
}
.drawer-min .decorate {
  bottom: auto !important;
  height: auto !important;
}
@media (max-width: 760px) {
  .editing .decorate {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 46dvh;
    border-radius: 24px 24px 0 0;
    padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px #40573a26;
  }
  .editing .decorate::before {
    content: "";
    display: block;
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: #d6d8c6;
    margin: 4px auto 6px;
  }
  .editing.drawer-min .decorate {
    top: auto !important;
    bottom: 0 !important;
  }
  .editing .care,
  .editing #bubble,
  .editing .view-tools,
  .editing .decor-launch,
  .editing .focus-launch,
  .editing .intro .mode,
  .editing .workspace aside,
  .editing #live-strip {
    display: none !important;
  }
}
/* v4.7: twelve-kind chooser */
#adopt .species {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
#adopt .species button {
  padding: 6px 4px 8px;
  min-height: 0;
  position: relative;
}
#adopt .species img {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 2px;
}
#adopt .species img:not([src]) {
  visibility: hidden;
}
#adopt .species strong {
  font-size: 11px;
}
#adopt .species small {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 8px;
  background: #f3e3bd;
  color: #8a6a2c;
}
#adopt .species small:empty {
  display: none;
}
#adopt .species button.locked:not(.selected) {
  border-style: dashed;
}
#coats {
  flex-wrap: wrap;
}
#adopt .species {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#adopt .species button {
  min-width: 0;
}
#adopt .species img {
  width: min(64px, 100%);
  height: auto;
  aspect-ratio: 1;
}
/* v4.7: photo mode and bedside clock */
.view-tools .vt-photo,
.view-tools .vt-clock {
  font-size: 15px;
}
.photo-mode header,
.photo-mode .intro,
.photo-mode .care,
.photo-mode .workspace aside,
.photo-mode .view-tools,
.photo-mode .decor-launch,
.photo-mode .focus-launch,
.photo-mode .scene-heading,
.photo-mode .room-bottom,
.photo-mode #bubble,
.photo-mode #live-strip,
.photo-mode #chat-sheet,
.clock-mode header,
.clock-mode .intro,
.clock-mode .care,
.clock-mode .workspace aside,
.clock-mode .view-tools,
.clock-mode .decor-launch,
.clock-mode .focus-launch,
.clock-mode .scene-heading,
.clock-mode .room-bottom,
.clock-mode #bubble,
.clock-mode #live-strip,
.clock-mode #chat-sheet {
  display: none !important;
}
#photo-bar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 40px;
  background: rgba(255, 252, 243, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px #40573a2e;
}
#photo-bar button {
  font-size: 13px;
  color: #3f5148;
  padding: 8px 10px;
  border-radius: 20px;
}
#photo-bar .pb-x {
  font-size: 22px;
  padding: 2px 10px;
}
#photo-bar .pb-shutter {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid #526f50;
  box-shadow:
    inset 0 0 0 4px #fff,
    inset 0 0 0 30px #e48a7c33;
}
.flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #fff;
  animation: flash 0.26s ease-out forwards;
  pointer-events: none;
}
@keyframes flash {
  from {
    opacity: 0.9;
  }
  to {
    opacity: 0;
  }
}
#photo-result {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: rgba(40, 48, 38, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#photo-result img {
  max-width: min(420px, 100%);
  max-height: 68dvh;
  border-radius: 14px;
  box-shadow: 0 20px 60px #0005;
  transform: rotate(-1.5deg);
}
.pr-actions {
  display: flex;
  gap: 10px;
}
.pr-actions button {
  padding: 13px 18px;
  border-radius: 16px;
  background: #fffcf3;
  font-size: 14px;
}
.pr-actions .primary {
  background: #526f50;
  color: #fff;
}
.clock-mode .room::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 22, 38, 0.72),
    rgba(18, 22, 38, 0.35) 55%,
    rgba(18, 22, 38, 0.6)
  );
  pointer-events: none;
}
#clock-face {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(70px + env(safe-area-inset-top));
  color: #f4ecd8;
  text-align: center;
  pointer-events: none;
}
.cf-time {
  font:
    300 clamp(64px, 20vw, 140px) / 1 Manrope,
    "DM Sans",
    sans-serif;
  letter-spacing: -3px;
  text-shadow: 0 0 30px #ffe9b455;
}
.cf-date {
  margin-top: 8px;
  font-size: 15px;
  opacity: 0.8;
}
.cf-pet {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.55;
}
.cf-done {
  pointer-events: auto;
  position: absolute;
  bottom: calc(26px + env(safe-area-inset-bottom));
  padding: 10px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #f4ecd8;
  font-size: 13px;
}
/* v4.9: furniture options sheet */
.item-sheet {
  padding-top: 4px;
}
.item-sheet.enter {
  animation: sheet-in 0.22s ease-out;
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
.item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.item-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
#item-back {
  border: 1px solid #dce1cf;
  border-radius: 12px;
  background: #f4f4e9;
  padding: 7px 11px;
  font-size: 12px;
}
.item-sheet h4 {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: #6f7a63;
  margin: 14px 0 8px;
  font-weight: 600;
}
.look-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.look-grid .look {
  position: relative;
  border: 1.5px solid #dce1cf;
  border-radius: 14px;
  background: #f5f2e7;
  padding: 6px 4px 8px;
  font-size: 10px;
}
.look-grid .look img,
.look-solo img {
  display: block;
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  margin: 0 auto 4px;
}
.look-solo img {
  max-width: 110px;
}
.look-grid .look.active {
  border-color: #789361;
  background: #e5ecd7;
  color: #45613c;
}
.look-grid .look.locked img {
  opacity: 0.85;
}
.look-grid .look .price {
  position: absolute;
  top: 5px;
  right: 5px;
}
.item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.item-actions button {
  border: 1px solid #dce1cf;
  border-radius: 10px;
  background: #fffdf2;
  padding: 8px 10px;
  font-size: 11px;
}
.item-actions .move-controls {
  gap: 4px;
}
.item-sheet .editor-footer {
  margin-top: 14px;
}
/* v4.9.2: folded view needs the hinge across the picture */
.fold-sideways::after {
  content: "Turn your phone so the hinge runs across the middle (check rotation lock is off).";
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  background: #fffcf3ee;
  box-shadow: 0 10px 30px #40573a26;
  color: #3f5148;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}
/* v4.10: pantry */
#pantry-pop {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  width: min(380px, calc(100% - 24px));
  max-height: min(70dvh, 560px);
  overflow: auto;
  padding: 14px;
  border-radius: 20px;
  background: #fffcf3f7;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px #40573a2e;
}
#pantry-pop[hidden] {
  display: none;
}
.pp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.pp-head h4 {
  margin: 0;
  font-size: 13px;
}
.pp-head span {
  font-size: 11px;
  color: #6c7f5c;
  white-space: nowrap;
}
.pp-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.pp-tabs button {
  flex: 1;
  border: 1px solid #dce1cf;
  border-radius: 12px;
  background: #f4f4e9;
  padding: 7px 4px;
  font-size: 11px;
}
.pp-tabs button.active {
  border-color: #789361;
  background: #e5ecd7;
  color: #45613c;
  font-weight: 600;
}
.pp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.pp-grid button {
  position: relative;
  border: 1px solid #dce1cf;
  border-radius: 13px;
  background: #f5f2e7;
  padding: 4px 3px 7px;
  font-size: 9.5px;
  line-height: 1.2;
}
.pp-grid button img {
  display: block;
  width: 100%;
  max-width: 64px;
  aspect-ratio: 1;
  margin: 0 auto 2px;
}
.pp-grid button.last {
  border-color: #789361;
  background: #eef3e4;
}
.pp-grid button.locked {
  border-style: dashed;
}
.pp-grid button.locked img {
  opacity: 0.8;
}
.pp-grid .price {
  position: absolute;
  top: 3px;
  right: 3px;
}
.pp-grid .fav {
  position: absolute;
  top: 3px;
  left: 5px;
  font-style: normal;
  color: #e06a6a;
  font-size: 12px;
}
#pantry-pop p {
  margin: 10px 0 0;
  font-size: 10px;
  color: #6c7f5c;
}
/* v4.10: chat translation */
.cs-tr {
  display: block;
  margin-top: 2px;
  color: #5d7356;
  font-style: italic;
}
.cs-trbtn {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid #d6dcc8;
  border-radius: 9px;
  background: #f4f4e9;
  color: #5d7356;
  font-size: 10px;
}
.sheet .eyebrow {
  text-transform: uppercase;
}
.away-list {
  margin: 4px 0 8px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
img.loading {
  border-radius: 50%;
  background: radial-gradient(circle, #ece6d6 0 45%, transparent 46%);
}
/* The last-message line keeps its Translate button visible however long the message is. */
.ls-last {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ls-last > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ls-last .cs-trbtn {
  flex: none;
}
/* v4.12: keep everything inside the phone's safe area (status bar, camera, home bar).
   The body becomes the containing block for every fixed-position element, so all the pinned
   controls move together; the html background fills the status-bar strip behind it. */
html {
  background: #e5eddf;
}
/* --sat can be set by ?sat=N in dev to preview a status bar in the browser. */
:root {
  --sat: env(safe-area-inset-top, 0px);
}
body {
  position: fixed;
  top: var(--sat);
  left: env(safe-area-inset-left, 0px);
  right: env(safe-area-inset-right, 0px);
  bottom: 0;
  transform: translateZ(0);
}
/* Modal cards live in the top layer (outside the body box), so they keep clear of the status bar
   and home bar themselves. */
dialog {
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  margin-top: calc(env(safe-area-inset-top, 0px) + 12px);
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
}
/* Phones: the room title wraps instead of running under the pet card. */
@media (max-width: 760px) {
  .intro h1 {
    max-width: calc(100vw - 236px);
    line-height: 1.1;
  }
}
/* v4.14: messages with friends */
.fr-chat {
  position: relative;
  border: 1px solid #dce1cf;
  border-radius: 12px;
  background: #f4f4e9;
  padding: 6px 9px;
  font-size: 13px;
  margin-right: 6px;
}
.fr-chat i {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e0604f;
  color: #fff;
  font: 700 10px/17px system-ui, sans-serif;
  font-style: normal;
}
.fr-last {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.fr-last.new {
  color: #3f5148 !important;
  font-weight: 600;
}
.chat-panel {
  display: flex;
  flex-direction: column;
}
.chat-panel .book-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-panel .ct-name {
  flex: 1;
  font-size: 16px;
}
.ct-back,
.ct-visit {
  border: 1px solid #dce1cf;
  border-radius: 12px;
  background: #f4f4e9;
  padding: 6px 11px;
  font-size: 12px;
}
.ct-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ct-day,
.ct-empty {
  align-self: center;
  margin: 6px 0;
  font-size: 11px;
  color: #8a9279;
  text-align: center;
}
.ct-msg {
  max-width: 80%;
  align-self: flex-start;
  background: #fffdf5;
  border: 1px solid #e3e3d3;
  border-radius: 16px 16px 16px 4px;
  padding: 8px 12px;
}
.ct-msg.mine {
  align-self: flex-end;
  background: #dfeacd;
  border-color: #cddcb9;
  border-radius: 16px 16px 4px 16px;
}
.ct-msg p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}
.ct-msg .ct-tr {
  margin-top: 4px;
  color: #5d7356;
  font-style: italic;
}
.ct-msg small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #8a9279;
}
.ct-msg small button {
  padding: 0;
  border: 0;
  background: none;
  color: #5d7356;
  font-size: 10px;
  text-decoration: underline;
}
.ct-send {
  display: flex;
  gap: 8px;
  padding-top: 8px;
}
.ct-send input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dce1cf;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fffdf5;
}
.ct-send button {
  border-radius: 14px;
  padding: 0 16px;
  background: #526f50;
  color: #fff;
}
.msg-toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: 70px;
  transform: translate(-50%, -16px);
  opacity: 0;
  transition: 0.25s;
  width: min(360px, calc(100% - 32px));
  text-align: left;
  border: 0;
  border-radius: 16px;
  padding: 10px 14px;
  background: #fffcf3;
  border: 1px solid #e3e3d3;
  box-shadow: 0 10px 30px #40573a30;
}
.msg-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.msg-toast b {
  display: block;
  font-size: 12px;
}
.msg-toast span {
  display: block;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* v4.15: pet mood */
.mood {
  display: flex !important;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 8px 0 2px;
  font-size: 13px;
}
.mood > span {
  font-weight: 600;
}
.mood b {
  font-weight: 700;
}
.mood small {
  font-size: 11px;
  color: #7e8f71;
}
.mood-happy {
  color: #4d7a3e;
}
.mood-hungry,
.mood-sleepy,
.mood-lonely {
  color: #c0603f;
}
.pp-grid .pp-fx {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  color: #6c7f5c;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.pp-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 8px 0 0 !important;
}
/* v4.15: clearer visit bar */
#visit-bar .vb-head b {
  display: block;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.vb-actions > button,
.vb-actions .vb-done {
  flex: 1;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}
.vb-actions .vb-msg,
.vb-actions .vb-add {
  background: #526f50;
  color: #fff;
}
.vb-actions .vb-note {
  background: #f4e9dc;
  color: #8a4f2d;
}
.vb-actions .vb-done {
  background: #eef3e4;
  color: #4d7a3e;
}
.vb-actions .vb-report {
  flex: 0;
  background: none;
  color: #b0632f;
  font-size: 12px;
}
#visit-bar .vb-home {
  background: #f4f4e9;
  color: #3f5148;
  border: 1px solid #dce1cf;
}
.vb-hint {
  flex: 1 1 100%;
  margin: 0 0 2px;
  font-size: 11px;
  color: #7e8f71;
}
/* v4.15: fold views only on foldables; labelled photo/clock buttons */
body:not(.foldable) .intro .mode {
  display: none !important;
}
.view-tools .vt-label {
  width: auto !important;
  height: auto !important;
  min-height: 32px;
  padding: 2px 8px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 15px !important;
  line-height: 1.1;
}
.view-tools .vt-label span {
  font-size: 9px;
  color: #6c7f5c;
}
.welcome-list {
  margin: 8px 0 4px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
}
.welcome-list li {
  margin-bottom: 6px;
}
.vb-reactions[hidden] {
  display: none !important;
}
/* v4.16: need bars, visible on phones too */
.needs {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 8px !important;
}
.need span {
  display: block;
  font-size: 10px;
  color: #6c7f5c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.need i {
  display: block;
  height: 7px;
  margin-top: 3px;
  border-radius: 4px;
  background: #e6e9dd;
  overflow: hidden;
}
.need b {
  display: block;
  height: 100%;
  width: var(--v, 80%);
  border-radius: 4px;
  background: #8fb06e;
  transition: width 0.4s;
}
.need.mid b {
  background: #e3b04b;
}
.need.low b {
  background: #e0604f;
}
.need.low span {
  color: #c0503f;
  font-weight: 600;
}
.fr-gifts {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.fr-gifts button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff3df;
  border: 1px solid #ecd9a8;
  font-size: 13px;
  text-align: left;
}
.fr-gifts span {
  flex: 1;
}
.fr-gifts em {
  font-style: normal;
  font-weight: 600;
  color: #fff;
  background: #526f50;
  padding: 4px 10px;
  border-radius: 10px;
}
/* v4.17: compact pet card on phones; tap to open */
@media (max-width: 760px) {
  .pet-card {
    cursor: pointer;
    padding: 10px 12px !important;
  }
  .pet-card:not(.open) .bond,
  .pet-card:not(.open) .wish,
  .pet-card:not(.open) #edit-pet,
  .pet-card:not(.open) .mood small {
    display: none !important;
  }
  .pet-card:not(.open) .mood {
    margin: 2px 0 0;
  }
  .pet-card:not(.open) .needs {
    margin: 6px 0 0 !important;
  }
  .pet-card .pet-title::after {
    content: "▾";
    color: #9aa58c;
    font-size: 11px;
    margin-left: 6px;
  }
  .pet-card.open .pet-title::after {
    content: "▴";
  }
  .pet-card .pet-title {
    display: flex;
    align-items: center;
  }
  .pet-card .pet-title > div {
    flex: 1;
  }
}
