:root {
  color-scheme: light;
  --studio-top: #abaaa7;
  --studio-bottom: #aeadab;
  --ink: #2b2724;
  --muted: #716961;
  --copper: #a96232;
  --copper-light: #c98a58;
  --panel: rgba(242, 238, 232, 0.82);
  --line: rgba(65, 54, 46, 0.16);
  --soft-line: rgba(255, 255, 255, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--studio-top);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

body {
  display: grid;
  place-items: center;
}

.stage {
  --head-progress: 50%;
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(247, 244, 237, 0.18), transparent 40%),
    linear-gradient(180deg, var(--studio-top), var(--studio-bottom));
  color: var(--ink);
  cursor: ew-resize;
  isolation: isolate;
  touch-action: none;
  user-select: none;
}

.stage::before {
  position: absolute;
  z-index: -1;
  inset: -2px;
  content: "";
  background:
    linear-gradient(rgba(173, 172, 169, 0.08), rgba(173, 172, 169, 0.08)),
    url("./assets/dog-studio-backdrop.jpg?v=3") center / cover no-repeat;
  pointer-events: none;
}

.dog-media-shell {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(100vw, 177.407407vh);
  height: min(100vh, 56.367432vw);
  overflow: hidden;
  transform: translate(-50%, -50%);
  isolation: isolate;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}

.dog-video-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

#dog-video {
  z-index: 0;
}

.dog-action-layer {
  z-index: 1;
  opacity: 0;
  transform: translate(-0.51%, -0.72%) scale(1.005);
  transform-origin: center;
  transition: opacity 340ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.stage[data-mode="click"] #dog-click-video {
  opacity: 1;
}

.dog-click-target {
  position: absolute;
  z-index: 3;
  top: 52%;
  left: 50%;
  width: 30%;
  height: 94%;
  padding: 0;
  border: 0;
  border-radius: 44% 44% 26% 26%;
  outline: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  opacity: 0;
  touch-action: none;
  transform: translate(-50%, -50%);
}

.dog-click-target:disabled {
  pointer-events: none;
}

.dog-click-target:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(169, 98, 50, 0.72);
  outline-offset: 4px;
  background: rgba(255, 250, 244, 0.035);
}

.studio-wash,
.vignette {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.studio-wash {
  background:
    linear-gradient(90deg, rgba(238, 234, 227, 0.25), transparent 25%, transparent 75%, rgba(89, 77, 68, 0.06)),
    repeating-linear-gradient(90deg, transparent 0 159px, rgba(70, 59, 51, 0.025) 160px);
  mix-blend-mode: soft-light;
}

.vignette {
  background:
    linear-gradient(180deg, rgba(43, 39, 36, 0.05), transparent 18%, transparent 78%, rgba(43, 39, 36, 0.12)),
    radial-gradient(ellipse at center, transparent 48%, rgba(43, 39, 36, 0.09) 100%);
}

.brand-lockup {
  position: absolute;
  z-index: 6;
  top: clamp(22px, 3vw, 42px);
  left: clamp(24px, 3.6vw, 56px);
  display: flex;
  align-items: center;
  color: var(--ink);
  pointer-events: none;
}

.brand-emblem {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(82, 66, 55, 0.4);
  border-radius: 50%;
}

.brand-emblem::before,
.brand-emblem::after {
  position: absolute;
  width: 18px;
  height: 18px;
  content: "";
  border: 1px solid rgba(169, 98, 50, 0.48);
  border-radius: 50%;
}

.brand-emblem::before {
  transform: rotate(38deg) scaleX(0.58);
}

.brand-emblem::after {
  transform: rotate(-38deg) scaleY(0.58);
}

.brand-emblem i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 12px rgba(169, 98, 50, 0.46);
}

.brand-copy,
.brand-signature {
  display: grid;
  gap: 2px;
}

.brand-copy {
  margin-left: 13px;
  padding-left: 14px;
  border-left: 1px solid rgba(70, 58, 49, 0.22);
}

.brand-copy strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.brand-copy small,
.brand-signature small,
.brand-signature i {
  color: rgba(56, 49, 44, 0.54);
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.brand-signature {
  min-width: 126px;
  margin-left: 14px;
  padding: 6px 10px 6px 14px;
  border-left: 1px solid rgba(70, 58, 49, 0.18);
}

.brand-signature strong {
  color: var(--copper);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.intro-panel {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: clamp(218px, 15.5vw, 260px);
  width: min(300px, 22vw);
  transform: translateY(-42%);
  pointer-events: none;
}

.intro-panel p,
.control-heading p,
.section-heading > span {
  margin: 0;
  color: var(--copper);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.intro-panel h1 {
  max-width: 260px;
  margin: 10px 0 12px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 520;
  line-height: 1.18;
  letter-spacing: 0.04em;
}

.intro-panel > span {
  display: block;
  max-width: 278px;
  color: rgba(48, 43, 39, 0.66);
  font-size: 13px;
  line-height: 1.8;
}

.intro-axis {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: rgba(49, 43, 39, 0.52);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.intro-axis i {
  width: 30px;
  height: 1px;
  background: rgba(70, 58, 49, 0.2);
}

.identity-card {
  position: absolute;
  z-index: 5;
  bottom: clamp(28px, 4vw, 56px);
  left: clamp(28px, 4vw, 62px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid rgba(65, 54, 46, 0.14);
  border-radius: 13px;
  background: rgba(242, 238, 232, 0.48);
  box-shadow: 0 12px 30px rgba(64, 54, 47, 0.08);
  pointer-events: none;
}

.identity-dot,
.control-heading > span i,
.local-footer i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--copper-light);
  box-shadow: 0 0 9px rgba(169, 98, 50, 0.38);
}

.identity-card div {
  display: grid;
  gap: 2px;
}

.identity-card small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.identity-card strong {
  font-size: 11px;
  letter-spacing: 0.09em;
}

.dog-dialogue {
  position: absolute;
  z-index: 8;
  top: clamp(34px, 7vh, 74px);
  left: 50%;
  max-width: min(320px, 48vw);
  padding: 11px 15px;
  border: 1px solid rgba(66, 54, 46, 0.17);
  border-radius: 13px;
  background: rgba(247, 243, 237, 0.9);
  box-shadow: 0 14px 34px rgba(58, 49, 42, 0.12);
  color: rgba(43, 39, 36, 0.78);
  font-size: 12px;
  line-height: 1.55;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.dog-dialogue.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.loading-status {
  position: absolute;
  z-index: 9;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(67, 56, 48, 0.16);
  border-radius: 999px;
  background: rgba(241, 238, 233, 0.78);
  color: rgba(51, 45, 41, 0.68);
  font-size: 11px;
  transform: translate(-50%, -50%);
  transition: opacity 260ms ease, visibility 260ms ease;
  pointer-events: none;
}

.loading-status span {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(169, 98, 50, 0.28);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

.stage[data-state="ready"] .loading-status {
  visibility: hidden;
  opacity: 0;
}

.stage[data-state="error"] .loading-status {
  color: #77412f;
}

.panel-toggle {
  position: absolute;
  z-index: 12;
  top: 24px;
  right: 364px;
  display: flex;
  min-width: 74px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(65, 54, 46, 0.18);
  border-radius: 999px;
  background: rgba(242, 238, 232, 0.78);
  box-shadow: 0 10px 28px rgba(55, 47, 41, 0.09);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(110%);
  transition: right 230ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.panel-toggle[aria-expanded="false"] {
  right: 22px;
}

.panel-toggle > span {
  display: flex;
  gap: 3px;
}

.panel-toggle i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--copper);
}

.panel-toggle strong {
  font-size: 10px;
  letter-spacing: 0.12em;
}

.control-panel {
  position: absolute;
  z-index: 11;
  top: 22px;
  right: 22px;
  bottom: 22px;
  width: 320px;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(65, 54, 46, 0.17);
  border-radius: 24px;
  background: var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    0 22px 58px rgba(58, 49, 42, 0.14);
  opacity: 0;
  transform: translateX(24px);
  visibility: hidden;
  transition: opacity 230ms ease, transform 230ms ease, visibility 230ms ease;
  backdrop-filter: blur(20px) saturate(108%);
  scrollbar-width: none;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.control-panel::-webkit-scrollbar {
  display: none;
}

.control-panel.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}

.control-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.control-heading h2 {
  margin: 4px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
  font-weight: 620;
}

.control-heading > span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(169, 98, 50, 0.2);
  border-radius: 999px;
  color: rgba(82, 63, 49, 0.72);
  font-size: 8px;
  white-space: nowrap;
}

.control-heading > span i {
  width: 5px;
  height: 5px;
}

.panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 17px 0 18px;
  padding: 4px;
  border: 1px solid rgba(65, 54, 46, 0.1);
  border-radius: 12px;
  background: rgba(80, 67, 57, 0.045);
}

.panel-tabs button {
  min-height: 34px;
  padding: 6px 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(58, 50, 44, 0.58);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.panel-tabs button[aria-selected="true"] {
  background: rgba(255, 253, 249, 0.76);
  box-shadow: 0 5px 15px rgba(63, 53, 46, 0.08);
  color: var(--ink);
}

.panel-content[hidden] {
  display: none;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 3px 10px;
}

.section-heading > span {
  grid-column: 1 / -1;
  color: rgba(169, 98, 50, 0.72);
  font-size: 8px;
}

.section-heading > strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 18px;
}

.section-heading > b {
  padding: 4px 8px;
  border: 1px solid rgba(65, 54, 46, 0.12);
  border-radius: 999px;
  color: rgba(56, 49, 44, 0.66);
  font-size: 9px;
}

.position-meter {
  --panel-head-progress: 50%;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 15px;
  padding-top: 13px;
  color: rgba(62, 53, 47, 0.45);
  font-size: 8px;
  text-align: center;
}

.position-meter::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 100%;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: rgba(69, 58, 50, 0.13);
}

.position-meter i {
  position: absolute;
  top: -2px;
  left: var(--panel-head-progress);
  width: 10px;
  height: 10px;
  border: 2px solid rgba(248, 244, 237, 0.95);
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 2px 8px rgba(70, 52, 39, 0.18);
  transform: translateX(-50%);
}

.position-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 13px;
}

.position-presets button,
.feed-options button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(65, 54, 46, 0.12);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.46);
  color: rgba(53, 46, 41, 0.7);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.position-presets button:hover,
.position-presets button:focus-visible,
.position-presets button[aria-pressed="true"],
.feed-options button:hover,
.feed-options button:focus-visible {
  border-color: rgba(169, 98, 50, 0.42);
  background: rgba(255, 250, 244, 0.9);
  color: var(--ink);
  outline: none;
}

.position-presets button:active,
.feed-options button:active {
  transform: translateY(1px);
}

.position-presets i {
  color: var(--copper);
  font-size: 17px;
  font-style: normal;
}

.position-presets span,
.feed-options span {
  font-size: 9px;
  font-weight: 720;
}

.wide-action {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 9px;
  border: 1px solid rgba(65, 54, 46, 0.12);
  border-radius: 11px;
  background: rgba(255, 253, 249, 0.38);
  color: rgba(55, 47, 42, 0.72);
  font-size: 10px;
  cursor: pointer;
}

.wide-action:hover,
.wide-action:focus-visible {
  border-color: rgba(169, 98, 50, 0.36);
  outline: none;
}

.wide-action i {
  color: var(--copper);
  font-style: normal;
}

.range-control {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.range-control > span {
  display: flex;
  justify-content: space-between;
  color: rgba(53, 46, 41, 0.7);
  font-size: 10px;
  font-weight: 680;
}

.range-control b {
  color: var(--ink);
}

.range-control input {
  width: 100%;
  height: 3px;
  margin: 2px 0;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--copper) 0 var(--sensitivity-progress, 41%), rgba(70, 58, 49, 0.14) var(--sensitivity-progress, 41%) 100%);
  touch-action: pan-x;
}

.range-control input::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 2px solid #f7f2eb;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 2px 7px rgba(76, 57, 44, 0.22);
  cursor: pointer;
}

.range-control small {
  display: flex;
  justify-content: space-between;
  color: rgba(58, 50, 44, 0.42);
  font-size: 8px;
}

.range-control small i {
  font-style: normal;
}

.motion-action {
  margin-top: 13px;
}

.motion-status {
  margin: 7px 2px 0;
  color: rgba(57, 49, 44, 0.48);
  font-size: 8px;
  line-height: 1.5;
}

.stable-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(107, 120, 87, 0.2);
  border-radius: 12px;
  background: rgba(121, 136, 100, 0.055);
}

.stable-note > i {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(107, 120, 87, 0.34);
  border-radius: 50%;
  color: #6f7c5b;
  font-size: 11px;
  font-style: normal;
}

.stable-note span {
  display: grid;
  gap: 2px;
}

.stable-note strong {
  font-size: 9px;
}

.stable-note small {
  color: rgba(56, 49, 44, 0.46);
  font-size: 8px;
}

.satiety-card {
  margin-top: 15px;
  padding: 12px;
  border: 1px solid rgba(65, 54, 46, 0.11);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.38);
}

.satiety-card > div:first-child {
  display: flex;
  justify-content: space-between;
  color: rgba(56, 49, 44, 0.62);
  font-size: 9px;
}

.satiety-card strong {
  color: var(--copper);
}

.satiety-track {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(64, 53, 46, 0.1);
}

.satiety-track i {
  display: block;
  width: var(--satiety-progress, 74%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--copper), var(--copper-light));
  transition: width 320ms ease;
}

.satiety-card p {
  margin: 9px 0 0;
  color: rgba(56, 49, 44, 0.48);
  font-size: 8px;
  line-height: 1.55;
}

.feed-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.feed-options button {
  min-height: 65px;
}

.feed-options i {
  color: var(--copper);
  font-size: 17px;
  font-style: normal;
}

.feed-options b {
  color: rgba(169, 98, 50, 0.7);
  font-size: 8px;
}

.dog-chat-form {
  display: grid;
  gap: 7px;
  margin-top: 17px;
}

.dog-chat-form label {
  color: rgba(53, 46, 41, 0.68);
  font-size: 10px;
  font-weight: 720;
}

.dog-chat-form > div {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 6px;
}

.dog-chat-form input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(65, 54, 46, 0.12);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 253, 249, 0.6);
  color: var(--ink);
  font-size: 9px;
}

.dog-chat-form input:focus {
  border-color: rgba(169, 98, 50, 0.4);
}

.dog-chat-form button {
  border: 0;
  border-radius: 10px;
  background: var(--copper);
  color: #fff8f0;
  cursor: pointer;
}

.profile-portrait {
  position: relative;
  height: 108px;
  overflow: hidden;
  border: 1px solid rgba(65, 54, 46, 0.12);
  border-radius: 15px;
  background:
    linear-gradient(rgba(173, 172, 169, 0.12), rgba(173, 172, 169, 0.12)),
    url("./assets/dog-neutral-poster.jpg?v=3") center 43% / cover no-repeat;
}

.profile-portrait::after {
  position: absolute;
  right: 11px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  content: "CYBER / ONLINE";
  background: rgba(247, 243, 237, 0.78);
  color: var(--copper);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.profile-list {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
}

.profile-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(65, 54, 46, 0.08);
  font-size: 9px;
}

.profile-list dt {
  color: rgba(56, 49, 44, 0.48);
}

.profile-list dd {
  margin: 0;
  color: rgba(43, 39, 36, 0.76);
  font-weight: 680;
  text-align: right;
}

.profile-note {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 11px;
  background: rgba(169, 98, 50, 0.055);
  color: rgba(56, 49, 44, 0.52);
  font-size: 8px;
  line-height: 1.65;
}

.head-readout {
  position: absolute;
  z-index: 5;
  right: 370px;
  bottom: 34px;
  width: 154px;
  color: rgba(51, 44, 39, 0.58);
  pointer-events: none;
}

.head-readout > span {
  display: block;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.head-readout > strong {
  position: absolute;
  top: 0;
  right: 0;
  color: var(--ink);
  font-size: 9px;
}

.head-readout > div {
  position: relative;
  height: 1px;
  margin-top: 10px;
  background: rgba(66, 55, 47, 0.22);
}

.head-readout > div i {
  position: absolute;
  top: -3px;
  left: var(--head-progress);
  width: 7px;
  height: 7px;
  border: 1px solid var(--copper);
  border-radius: 50%;
  background: #d3d1cd;
  transform: translateX(-50%);
}

.head-readout small {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 7px;
}

.local-footer {
  position: absolute;
  z-index: 5;
  right: 370px;
  bottom: 15px;
  display: flex;
  gap: 14px;
  color: rgba(50, 43, 39, 0.42);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.local-footer span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}

.local-footer i {
  width: 5px;
  height: 5px;
}

.stage[data-presence="resting"] .identity-dot,
.stage[data-presence="resting"] .local-footer i {
  animation: presence-pulse 2.4s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes presence-pulse {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 1; }
}

@media (max-width: 1050px) {
  .intro-panel {
    display: none;
  }

  .head-readout,
  .local-footer {
    right: 355px;
  }
}

@media (min-width: 841px) and (max-width: 1050px) {
  .dog-media-shell {
    top: 51.5%;
    left: 49.8%;
    width: auto;
    height: min(70vh, 63.7vw);
    aspect-ratio: 1916 / 1080;
  }
}

@media (max-width: 840px), (hover: none) and (pointer: coarse) {
  html,
  body {
    height: 100%;
    min-height: 100%;
    overscroll-behavior: none;
  }

  body {
    display: block;
    touch-action: none;
  }

  .stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    cursor: default;
    background:
      linear-gradient(180deg, #abaaa7 0 55%, #aeadab 55% 100%);
  }

  .dog-media-shell {
    top: 52.5vh;
    top: 52.5dvh;
    left: 49.8%;
    width: min(138.37vh, 1170px);
    height: min(78vh, 660px);
    width: min(138.37dvh, 1170px);
    height: min(78dvh, 660px);
  }

  .dog-click-target {
    width: 28%;
  }

  .studio-wash {
    display: none;
  }

  .vignette {
    background:
      linear-gradient(180deg, rgba(43, 39, 36, 0.08), transparent 18%, transparent 78%, rgba(43, 39, 36, 0.15)),
      radial-gradient(ellipse at center, transparent 48%, rgba(43, 39, 36, 0.08) 100%);
  }

  .brand-lockup {
    top: max(15px, env(safe-area-inset-top));
    left: max(15px, env(safe-area-inset-left));
  }

  .brand-emblem {
    width: 34px;
    height: 34px;
  }

  .brand-emblem::before,
  .brand-emblem::after {
    width: 14px;
    height: 14px;
  }

  .brand-copy {
    margin-left: 9px;
    padding-left: 10px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .brand-copy small,
  .brand-signature small,
  .brand-signature i {
    display: none;
  }

  .brand-signature {
    min-width: 0;
    margin-left: 9px;
    padding: 4px 7px 4px 10px;
  }

  .brand-signature strong {
    font-size: 12px;
  }

  .identity-card,
  .intro-panel,
  .local-footer {
    display: none;
  }

  .panel-toggle {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    min-width: 46px;
    min-height: 44px;
    padding: 8px 10px;
    background: rgba(239, 235, 229, 0.96);
    box-shadow: 0 8px 22px rgba(55, 47, 41, 0.12);
    backdrop-filter: none;
  }

  .panel-toggle strong {
    display: none;
  }

  .control-panel {
    position: fixed;
    top: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    width: auto;
    max-height: min(72dvh, 610px);
    padding: 15px;
    border-radius: 20px;
    background: rgba(239, 235, 229, 0.97);
    box-shadow: 0 16px 38px rgba(52, 44, 38, 0.2);
    transform: translateY(22px);
    backdrop-filter: none;
  }

  .control-panel.is-open {
    transform: translateY(0);
  }

  .control-heading h2 {
    font-size: 17px;
  }

  .panel-tabs {
    margin: 13px 0 14px;
  }

  .panel-tabs button,
  .wide-action {
    min-height: 44px;
  }

  .range-control input::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .head-readout {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(17px, env(safe-area-inset-bottom));
    width: 132px;
  }

  .control-panel.is-open ~ .head-readout {
    opacity: 0;
  }

  .dog-dialogue {
    top: auto;
    bottom: max(146px, calc(env(safe-area-inset-bottom) + 132px));
    left: max(15px, env(safe-area-inset-left));
    max-width: min(230px, calc(100vw - 30px));
    font-size: 10px;
    transform: translate(0, 8px);
  }

  .dog-dialogue.is-visible {
    transform: translate(0, 0);
  }

  .loading-status {
    background: rgba(239, 235, 229, 0.94);
  }

  .dog-video-layer,
  .dog-action-layer {
    will-change: auto;
  }
}

@media (max-width: 360px) {
  .dog-media-shell {
    height: 74dvh;
    width: 131.28dvh;
  }

  .panel-tabs button {
    font-size: 8px;
  }

  .position-presets button,
  .feed-options button {
    min-height: 54px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .dog-media-shell {
    top: 50%;
    left: 50%;
    width: min(100vw, 177.407407vh);
    height: min(100vh, 56.367432vw);
  }

  .brand-signature,
  .head-readout,
  .dog-dialogue {
    display: none;
  }

  .control-panel {
    right: 10px;
    bottom: 10px;
    left: auto;
    width: min(320px, 48vw);
    max-height: calc(100dvh - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
