﻿@import url("./webfonts/lxgwwenkai-regular.css");

:root {
  --font-ui: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-serif: "LXGW WenKai", "Songti SC", "STSong", "SimSun", serif;
  --font-display: "LXGW WenKai", "STKaiti", "KaiTi", "Songti SC", "STSong", serif;
  --bg-0: #f4f9f7;
  --bg-1: #e5f0ec;
  --bg-2: #d6e6e0;
  --panel: #ffffff;
  --ink: #12223f;
  --muted: #4a5f77;
  --line: #ccdad6;
  --primary: #0f9078;
  --primary-hover: #0a7b67;
  --danger: #cf4f4f;
  --success: #17815f;
  --card-shadow: 0 24px 48px rgba(18, 34, 63, 0.12);
  --nav-strip-url: url("/images/nav/topbar-bg-strip.png");
  --rank-panel-bg-url: url("/images/backgrounds/animal-modal-bg-original.png");
  --mailbox-bg-url: url("/images/mailbox-bg.png");
  --auth-login-bg-url: url("/images/backgrounds/login-auth-bg.png");
  --animal-modal-bg-anchor-x-desktop: 64.40%;
  --animal-modal-bg-anchor-y-desktop: 100%;
  --animal-modal-bg-crop-width-desktop: 70.70%;
  --animal-modal-bg-crop-height-desktop: 100%;
  --animal-modal-bg-anchor-x-mobile: 71.2%;
  --animal-modal-bg-anchor-y-mobile: 100%;
  --animal-modal-bg-crop-width-mobile: 27.1%;
  --animal-modal-bg-crop-height-mobile: 100%;
  --animal-modal-bg-anchor-x: var(--animal-modal-bg-anchor-x-desktop);
  --animal-modal-bg-anchor-y: var(--animal-modal-bg-anchor-y-desktop);
  --animal-modal-bg-crop-width: var(--animal-modal-bg-crop-width-desktop);
  --animal-modal-bg-crop-height: var(--animal-modal-bg-crop-height-desktop);
  --animal-modal-crop-url: var(--rank-panel-bg-url);
  --animal-modal-bg-pos-x: 71.2%;
  --animal-modal-bg-pos-y: 100%;
  --animal-modal-bg-size-x: 369.0037%;
  --animal-modal-bg-size-y: 100%;
  --animal-modal-overlay: rgba(255, 255, 255, 0.28);
  --chat-bg-image: none;
  --chat-bg-overlay: rgba(255, 255, 255, 0);
}

@media (max-width: 860px) {
  :root {
    --animal-modal-bg-anchor-x: var(--animal-modal-bg-anchor-x-mobile);
    --animal-modal-bg-anchor-y: var(--animal-modal-bg-anchor-y-mobile);
    --animal-modal-bg-crop-width: var(--animal-modal-bg-crop-width-mobile);
    --animal-modal-bg-crop-height: var(--animal-modal-bg-crop-height-mobile);
  }
}

* {
  box-sizing: border-box;
}

html {
  overscroll-behavior: none;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 8% 8%, #ffffff 0%, transparent 34%),
    radial-gradient(circle at 88% 18%, #dbece7 0%, transparent 40%),
    linear-gradient(150deg, var(--bg-0) 0%, var(--bg-1) 54%, var(--bg-2) 100%);
  overscroll-behavior: none;
}

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

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(165deg, rgba(246, 251, 249, 0.82) 0%, rgba(231, 244, 239, 0.8) 55%, rgba(219, 238, 231, 0.78) 100%),
    var(--auth-login-bg-url) center center / cover no-repeat;
}

.auth-layout {
  width: min(1280px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: 1.16fr 0.84fr;
  border: 1px solid rgba(188, 207, 201, 0.75);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(4px);
  box-shadow: var(--card-shadow);
}

.auth-story {
  position: relative;
  padding: clamp(28px, 5vw, 58px);
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.22) 52%, transparent 72%),
    linear-gradient(165deg, #f9fdfb 0%, #ebf5f1 48%, #deeee8 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
}

.auth-story::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -78px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 145, 120, 0.18) 0%, rgba(20, 145, 120, 0.04) 60%, transparent 72%);
}

.story-badge {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #b8d5cd;
  background: rgba(255, 255, 255, 0.68);
  color: #2c5f56;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.auth-story h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.3vw, 46px);
  line-height: 1.12;
  letter-spacing: 0.03em;
  color: #0e4f45;
}

.auth-story h1 span {
  display: block;
}

.story-divider {
  position: relative;
  width: min(430px, 100%);
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8db9ad;
  font-size: 15px;
}

.story-divider::before,
.story-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 16px);
  border-top: 1px solid rgba(146, 194, 182, 0.58);
  transform: translateY(-50%);
}

.story-divider::before {
  left: 0;
}

.story-divider::after {
  right: 0;
}

.story-divider::selection {
  background: transparent;
}

.story-divider::before,
.story-divider::after {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.story-divider::after,
.story-divider::before {
  display: block;
  height: 0;
}

.story-divider::before,
.story-divider::after {
  content: "";
}

.story-divider::before,
.story-divider::after {
  pointer-events: none;
}

.story-prose {
  max-width: 680px;
  display: grid;
  gap: 18px;
}

.story-prose p {
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.25vw, 20px);
  line-height: 2.12;
  color: #223656;
}

.auth-panel {
  padding: clamp(20px, 3.4vw, 40px);
  display: grid;
  place-items: start center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 253, 251, 0.98) 100%);
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid #d7e6e1;
  border-radius: 20px;
  padding: 26px;
  background: #ffffff;
  box-shadow: 0 22px 38px rgba(20, 47, 61, 0.09);
}

.auth-kicker {
  font-family: var(--font-ui);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: #7a8588;
  margin-top: 2px;
}

.auth-card h2 {
  font-family: var(--font-serif);
  font-size: 46px;
  line-height: 1.1;
  color: #0f4f45;
}

.auth-title-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}

.auth-title-leaf {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4a9e88;
  font-size: 26px;
  background: linear-gradient(145deg, #f3faf7 0%, #e5f4ee 100%);
  border: 1px solid #d5ebe3;
}

.auth-mode-switch {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-btn {
  border: 1px solid #bdd8d2;
  border-radius: 12px;
  background: #f8fcfb;
  color: #3a5658;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-ui);
  transition: all 0.18s ease;
}

.mode-btn.active {
  border-color: transparent;
  background: linear-gradient(135deg, #148f79 0%, #21a38b 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(20, 143, 121, 0.28);
}

.auth-form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.field-label {
  font-family: var(--font-serif);
  font-size: 13px;
  color: #476070;
}

.auth-form input {
  width: 100%;
  border: 1px solid #ccddda;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--ink);
  font-family: var(--font-ui);
  background: rgba(253, 254, 253, 0.92);
  outline: none;
  transition: all 0.16s ease;
}

.auth-form input:focus {
  border-color: #7cc6b7;
  box-shadow: 0 0 0 4px rgba(15, 144, 120, 0.14);
  background: #ffffff;
}

.auth-input-row {
  --auth-input-font-size: 16px;
  --auth-input-line-height: 1.25;
  position: relative;
  border: 1px solid #d7e8e3;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  min-height: 66px;
  display: flex;
  align-items: center;
  padding: 0 16px 0 52px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.auth-input-row:focus-within {
  border-color: #74bcae;
  box-shadow: 0 0 0 4px rgba(15, 144, 120, 0.13);
  background: #ffffff;
}

.auth-input-row input {
  border: 0;
  background: transparent;
  padding: 0;
  height: 100%;
  width: 100%;
  display: block;
  font-size: var(--auth-input-font-size);
  line-height: var(--auth-input-line-height);
  box-shadow: none !important;
}

.auth-input-row-password .password-visible-input {
  display: none;
}

.auth-input-row-password.password-visible #passwordInput {
  display: none;
}

.auth-input-row-password.password-visible .password-visible-input {
  display: block;
}

.auth-input-row input::placeholder {
  color: #a4afb2;
}

.auth-input-row .auth-input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  background: #5e9f8b;
  opacity: 0.92;
}

.auth-icon-user {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12.6a5.4 5.4 0 1 0 0-10.8 5.4 5.4 0 0 0 0 10.8Zm0 2.2c-5.11 0-9.2 2.68-9.2 6.1 0 .66.54 1.1 1.2 1.1h16c.66 0 1.2-.44 1.2-1.1 0-3.42-4.09-6.1-9.2-6.1Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12.6a5.4 5.4 0 1 0 0-10.8 5.4 5.4 0 0 0 0 10.8Zm0 2.2c-5.11 0-9.2 2.68-9.2 6.1 0 .66.54 1.1 1.2 1.1h16c.66 0 1.2-.44 1.2-1.1 0-3.42-4.09-6.1-9.2-6.1Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.auth-icon-lock {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.8 10.1h-.95V7.9c0-2.67-2.18-4.85-4.85-4.85S7.15 5.23 7.15 7.9v2.2H6.2A2.2 2.2 0 0 0 4 12.3v7.5A2.2 2.2 0 0 0 6.2 22h11.6a2.2 2.2 0 0 0 2.2-2.2v-7.5a2.2 2.2 0 0 0-2.2-2.2Zm-3.15 0H9.35V7.9A2.65 2.65 0 0 1 12 5.25a2.65 2.65 0 0 1 2.65 2.65v2.2Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.8 10.1h-.95V7.9c0-2.67-2.18-4.85-4.85-4.85S7.15 5.23 7.15 7.9v2.2H6.2A2.2 2.2 0 0 0 4 12.3v7.5A2.2 2.2 0 0 0 6.2 22h11.6a2.2 2.2 0 0 0 2.2-2.2v-7.5a2.2 2.2 0 0 0-2.2-2.2Zm-3.15 0H9.35V7.9A2.65 2.65 0 0 1 12 5.25a2.65 2.65 0 0 1 2.65 2.65v2.2Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.auth-input-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  margin-top: -14px;
  transform: none;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 8px;
  background: transparent !important;
  cursor: pointer;
  color: transparent;
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.auth-input-eye::before,
.auth-input-eye::after {
  content: none;
}

.auth-input-eye .eye-icon {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  transform: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.auth-input-eye .eye-off {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.8 12s3.2-5.7 9.2-5.7S21.2 12 21.2 12s-3.2 5.7-9.2 5.7S2.8 12 2.8 12Z' stroke='%239da4a8' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='2.7' stroke='%239da4a8' stroke-width='1.9'/%3E%3Cpath d='M4.2 19.8 19.8 4.2' stroke='%239da4a8' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E");
  opacity: 1;
}

.auth-input-eye .eye-on {
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.8 12s3.2-5.7 9.2-5.7S21.2 12 21.2 12s-3.2 5.7-9.2 5.7S2.8 12 2.8 12Z' stroke='%238c9297' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='2.7' stroke='%238c9297' stroke-width='1.9'/%3E%3C/svg%3E")
    center / contain no-repeat;
  opacity: 0;
}

.auth-input-eye.active {
  color: transparent;
}

.auth-input-eye.active .eye-off {
  opacity: 0;
}

.auth-input-eye.active .eye-on {
  opacity: 1;
}

.auth-input-row-password input::-ms-reveal,
.auth-input-row-password input::-ms-clear {
  display: none;
}

.auth-input-row-password input::-webkit-contacts-auto-fill-button,
.auth-input-row-password input::-webkit-credentials-auto-fill-button {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.auth-link-btn {
  margin-top: 16px;
  width: 100%;
  justify-self: stretch;
  border: none;
  background: transparent;
  color: #8a9498;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 12px 0 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.auth-link-btn::before,
.auth-link-btn::after {
  content: "";
  flex: 1;
  border-top: 1px solid #d9e6e2;
}

.auth-link-btn:hover {
  color: #64857d;
}

.auth-link-btn.hidden {
  display: none;
}

.display-name-group.hidden {
  display: none;
}

.register-extra-group.hidden {
  display: none;
}

.register-extra-group {
  display: grid;
  gap: 8px;
}

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

.gender-option {
  position: relative;
  border: 1px solid #ccddda;
  border-radius: 12px;
  background: #f8fcfb;
  color: #2f4f68;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.gender-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gender-option:hover {
  border-color: #7fc6b7;
  background: #f2fbf8;
}

.gender-option:has(input:checked) {
  border-color: #17957d;
  background: linear-gradient(135deg, #e8f8f3 0%, #dcf5ee 100%);
  color: #0f6657;
  box-shadow: 0 8px 20px rgba(23, 149, 125, 0.14);
}

.submit-btn {
  margin-top: 10px;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, #0f9078 0%, #22af93 100%);
  font-size: 16px;
  font-family: var(--font-ui);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(16, 143, 121, 0.28);
}

.submit-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.secondary-submit-btn {
  display: none;
  margin-top: 8px;
  border: 1px solid #bfdcd4;
  border-radius: 14px;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.85);
  color: #2b7b6a;
  font-size: 18px;
  font-family: var(--font-serif);
  cursor: pointer;
}

.auth-msg {
  margin-top: 12px;
  min-height: 20px;
  font-size: 14px;
  color: #466174;
}

.auth-msg.error {
  color: var(--danger);
}

.auth-msg.success {
  color: var(--success);
}

.story-start-btn {
  display: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 29, 41, 0.38);
  backdrop-filter: blur(2px);
}

.auth-beian {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 3200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(173, 198, 191, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(16, 46, 58, 0.08);
  white-space: nowrap;
  font-size: 12px;
  line-height: 1;
  color: #4f6579;
}

.auth-beian a {
  color: #215d89;
  text-decoration: none;
}

.auth-beian a:hover {
  text-decoration: underline;
}

.reset-card {
  width: min(520px, 100%);
  border: 1px solid #c8ddd8;
  border-radius: 18px;
  background: linear-gradient(160deg, #ffffff 0%, #f4fbf8 100%);
  box-shadow: 0 20px 38px rgba(14, 39, 50, 0.2);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.reset-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.reset-head h3 {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.1;
  color: #163a62;
}

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

.reset-step-tag {
  border: 1px solid #cfe1dc;
  border-radius: 999px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  color: #4a6779;
  background: rgba(247, 252, 250, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reset-step-tag.active {
  border-color: #8bcdbc;
  color: #0d6657;
  background: linear-gradient(135deg, #e8f8f3 0%, #dbf3ec 100%);
}

.reset-step-panel {
  display: grid;
  gap: 8px;
}

.reset-step-panel .field-label {
  margin-top: 2px;
  font-size: 14px;
  color: #35566b;
}

.reset-step-panel input {
  width: 100%;
  border: 1px solid #c8ddd8;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  color: #14314d;
  font-family: var(--font-ui);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.reset-step-panel input:focus {
  border-color: #73bfaf;
  box-shadow: 0 0 0 4px rgba(16, 143, 121, 0.14);
  background: #ffffff;
}

.reset-step-panel input.input-invalid,
.profile-setting-field input.input-invalid,
.profile-email-verify-actions input.input-invalid {
  border-color: #cf5f5f !important;
  box-shadow: 0 0 0 3px rgba(207, 95, 95, 0.14) !important;
  background: rgba(255, 247, 247, 0.96) !important;
}

.reset-step-actions {
  margin-top: 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 8px;
}

.reset-step-actions .submit-btn,
.reset-step-actions .mode-btn {
  margin-top: 0;
}

.reset-success-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: #105d51;
}

.reset-success-copy {
  color: #476273;
  font-size: 14px;
}

.zoo-page {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.zoo-page.chat-tab-active {
  overflow-y: hidden;
}

.zoo-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.zoo-topbar {
  border: 1px solid rgba(194, 214, 209, 0.86);
  border-radius: 14px;
  position: relative;
  z-index: 220;
  overflow: visible;
  isolation: isolate;
  background:
    linear-gradient(0deg, rgba(248, 253, 251, 0.78), rgba(248, 253, 251, 0.78)),
    var(--nav-strip-url) center center / cover no-repeat;
  backdrop-filter: blur(6px);
  box-shadow: 0 14px 28px rgba(12, 38, 48, 0.08);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.zoo-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zoo-brand-main {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
  color: #10213c;
}

.zoo-brand-sub {
  font-family: var(--font-serif);
  font-size: 12px;
  color: #40637a;
}

.zoo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.top-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid #d3e3df;
  border-radius: 999px;
  background: #f5fbf9;
}

.top-tab {
  position: relative;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #2c5066;
  font-size: 13px;
  padding: 5px 10px;
}

.top-tab.active {
  color: #0f5f53;
  border-color: #b8ddd4;
  background: #e7f6f1;
}

.tab-unread-badge {
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #d94d4d;
  color: #ffffff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  display: inline-block;
  padding: 0 4px;
  margin-left: 4px;
}

.zoo-main-shell {
  height: 100%;
  min-height: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.tab-view {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.tab-view.hidden {
  display: none;
}

.panel-card {
  border: 1px solid rgba(190, 211, 204, 0.84);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.72) 0%, transparent 36%),
    radial-gradient(circle at 86% 22%, rgba(189, 228, 218, 0.42) 0%, transparent 40%),
    linear-gradient(160deg, #eff9f5 0%, #e0f0eb 58%, #d5e8e2 100%);
  box-shadow: 0 16px 28px rgba(13, 37, 46, 0.08);
  height: 100%;
  min-height: clamp(360px, calc(100vh - 190px), 920px);
  min-height: clamp(360px, calc(100dvh - 190px), 920px);
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  color: #0f284a;
}

.current-user {
  appearance: none;
  border: 1px solid #c9ddd8;
  border-radius: 999px;
  background: rgba(237, 248, 245, 0.94);
  color: #2b625a;
  padding: 4px 9px 4px 5px;
  min-height: 42px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.current-user-menu {
  position: relative;
  z-index: 260;
}

.current-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #b7d7d0;
  background: linear-gradient(150deg, #f6fcfa 0%, #e2f3ee 100%);
  color: #2a5a6b;
  font-weight: 700;
  font-size: 13px;
  line-height: 28px;
  text-align: center;
  flex: 0 0 auto;
}

.current-user-content {
  display: grid;
  gap: 1px;
  text-align: left;
  min-width: 0;
}

.current-user-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #5f7f8f;
}

.current-user-name {
  font-size: 15px;
  color: #21455e;
  font-family: var(--font-serif);
  line-height: 1.1;
  max-width: 188px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-user-caret {
  color: #2d6070;
  font-size: 14px;
  line-height: 1;
  margin-left: 2px;
  transition: transform 0.18s ease;
}

.current-user-menu.open .current-user-caret {
  transform: rotate(180deg);
}

.current-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid #c4dcd6;
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(241, 250, 247, 0.96) 100%),
    var(--nav-strip-url) center center / cover no-repeat;
  box-shadow: 0 22px 38px rgba(13, 41, 54, 0.2);
  display: grid;
  gap: 8px;
  z-index: 520;
}

.current-user-dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 20px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-top: 1px solid #c4dcd6;
  border-left: 1px solid #c4dcd6;
  background: rgba(248, 253, 251, 0.96);
}

.current-user-dropdown-head {
  display: grid;
  gap: 2px;
  padding: 2px 4px 4px;
}

.current-user-dropdown-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: #12345a;
  line-height: 1.2;
}

.current-user-dropdown-sub {
  font-size: 12px;
  color: #567082;
}

.current-user-dropdown-group {
  display: grid;
  gap: 7px;
}

.current-user-dropdown-item {
  border: 1px solid #d0e2dd;
  border-radius: 12px;
  background: rgba(247, 252, 250, 0.88);
  color: #2e5567;
  font-size: 13px;
  text-align: left;
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  display: grid;
  gap: 3px;
}

.current-user-dropdown-item .item-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #16395c;
}

.current-user-dropdown-item .item-sub {
  font-size: 12px;
  color: #587385;
  line-height: 1.42;
}

.current-user-dropdown-item:hover {
  border-color: #b9ddd3;
  background: #ebf7f3;
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(15, 73, 79, 0.08);
}

.current-user-dropdown-item:hover .item-title {
  color: #0f6958;
}

.current-user-dropdown-item.active {
  border-color: #8acdbd;
  background: linear-gradient(160deg, #e4f6f0 0%, #d6efe7 100%);
  box-shadow: 0 9px 15px rgba(17, 100, 87, 0.12);
}

.current-user-dropdown-item.active .item-title {
  color: #0d6455;
}

.current-user-dropdown-item.active .item-sub {
  color: #3f6f66;
}

.current-user-dropdown-logout .item-title {
  color: #914747;
}

.current-user-dropdown-logout:hover {
  border-color: rgba(207, 79, 79, 0.34);
  background: #fff3f3;
}

.current-user-dropdown-logout:hover .item-title {
  color: #b84646;
}

.zoo-actions > button {
  padding: 7px 12px;
  font-size: 13px;
}

.current-user:hover {
  background: #e4f4ef;
}

.current-user-menu.open .current-user {
  border-color: #89c9bc;
  background: #def2ec;
  box-shadow: 0 8px 18px rgba(18, 95, 92, 0.14);
}

.current-user:focus-visible {
  outline: none;
  border-color: #8fcabf;
  box-shadow: 0 0 0 3px rgba(43, 132, 115, 0.2);
}

.rank-periods {
  display: inline-flex;
  gap: 6px;
}

.period-btn {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.period-btn.active {
  border-color: #88c8ba;
  background: #e8f8f3;
  color: #0f6a5b;
}

.rank-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(
      120deg,
      rgba(247, 252, 250, 0.54) 0%,
      rgba(232, 245, 240, 0.44) 46%,
      rgba(217, 237, 230, 0.38) 100%
    ),
    var(--rank-panel-bg-url);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.rank-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.08) 42%, transparent 70%),
    linear-gradient(108deg, rgba(10, 46, 57, 0.12) 0%, rgba(18, 60, 73, 0.08) 52%, rgba(14, 44, 58, 0.18) 100%);
  pointer-events: none;
  z-index: 0;
}

.rank-panel > * {
  position: relative;
  z-index: 1;
}

.rank-list {
  overflow: auto;
  display: grid;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 8px;
  padding-right: 2px;
}

.rank-item {
  display: grid;
  grid-template-columns: auto 70px 1fr auto;
  align-items: center;
  gap: 10px;
  height: 90px;
  border: 1px solid rgba(176, 205, 196, 0.82);
  border-radius: 12px;
  background: rgba(251, 254, 253, 0.38);
  backdrop-filter: blur(2px);
  padding: 8px;
  overflow: hidden;
}

.rank-index {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e3f3ee;
  color: #0f6b5c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.rank-preview {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  border: 1px solid #caded8;
  object-fit: contain;
  background: #f7fcfb;
  cursor: pointer;
}

.rank-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rank-animal {
  font-family: var(--font-serif);
  font-size: 18px;
  color: #173b63;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-owner {
  color: #48677b;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.rank-owner-label {
  flex: 0 0 auto;
}

.rank-owner-name {
  min-width: 0;
  flex: 1 1 auto;
}

.rank-owner-name .inline-user-link {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-owner .user-presence-badge {
  flex: 0 0 auto;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-likes {
  color: #0f6d5f;
  font-weight: 700;
  font-size: 13px;
}

.mailbox-panel {
  position: relative;
  isolation: isolate;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 12px;
  overflow: hidden;
  background:
    linear-gradient(
      108deg,
      rgba(248, 245, 238, 0.94) 0%,
      rgba(245, 247, 247, 0.9) 42%,
      rgba(233, 244, 250, 0.74) 66%,
      rgba(219, 236, 249, 0.56) 100%
    ),
    var(--mailbox-bg-url);
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}

.mailbox-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.14) 48%, transparent 76%),
    linear-gradient(
      96deg,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(255, 255, 255, 0.08) 44%,
      rgba(20, 54, 82, 0.2) 74%,
      rgba(13, 39, 66, 0.3) 100%
    );
  pointer-events: none;
  z-index: 0;
}

.mailbox-panel > * {
  position: relative;
  z-index: 1;
}

.mailbox-letter-card {
  position: relative;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 4px 4px 0 8px;
  overflow: auto;
}

.mailbox-letter-card::before {
  content: "“";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1;
  color: rgba(20, 77, 106, 0.22);
}

.mailbox-letter-card::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 16px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(53, 135, 118, 0.35) 0%, rgba(53, 135, 118, 0.08) 100%);
}

.mailbox-letter-text {
  margin: 0;
  padding: 8px 0 0 24px;
  display: grid;
  gap: 8px;
  max-width: min(980px, 100%);
}

.mailbox-letter-line {
  margin: 0;
  color: #2a4e67;
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.84;
  letter-spacing: 0.01em;
  text-wrap: pretty;
  max-width: 100%;
}

.mailbox-entry-cta {
  border: none;
  border-top: 1px dashed rgba(64, 129, 113, 0.4);
  background: transparent;
  padding: 8px 2px 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
}

.mailbox-entry-lead {
  margin: 0;
  color: #33556c;
  font-size: 13px;
  line-height: 1.7;
  max-width: 100%;
}

.mailbox-entry-lead::before {
  content: "↘ ";
  color: #2f8a79;
}

.mailbox-entry-cta #openMailboxFormBtn {
  justify-self: end;
  margin-right: 40px;
  border-radius: 999px;
  padding: 9px 16px;
  box-shadow: 0 10px 18px rgba(21, 119, 101, 0.16);
}

.mailbox-status {
  width: 100%;
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: #2e6179;
  font-size: 12px;
}

.mailbox-modal {
  width: min(540px, 96vw);
  border: 1px solid #c9ddd8;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 42px rgba(16, 34, 47, 0.22);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.mailbox-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mailbox-modal-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  color: #123260;
}

#mailboxInput {
  width: 100%;
  min-height: 180px;
  max-height: 340px;
  resize: vertical;
  border: 1px solid #cde0db;
  border-radius: 12px;
  padding: 10px;
  font-family: var(--font-ui);
}

#mailboxInput:focus {
  border-color: #83c8b9;
  box-shadow: 0 0 0 3px rgba(15, 144, 120, 0.12);
  outline: none;
}

.mailbox-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-panel {
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.chat-panel .panel-head {
  display: none;
}

.chat-layout {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 10px;
  overflow: visible;
}

.chat-conversation-pane,
.chat-thread-pane {
  border: 1px solid #cde0db;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-conversation-list {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.chat-conversation-item {
  width: 100%;
  border: 1px solid #d3e2de;
  border-radius: 10px;
  background: #f9fdfc;
  padding: 8px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 3px;
  text-align: left;
  transform: none;
  box-shadow: none;
  cursor: pointer;
  height: 84px;
  overflow: hidden;
}

.chat-conversation-item:hover:not(.disabled) {
  transform: none;
  box-shadow: none;
  border-color: #b6d7d0;
  background: #f2fbf8;
}

.chat-conversation-item.active {
  border-color: #89c9bb;
  background: #e9f7f3;
}

.chat-conversation-item.disabled {
  cursor: default;
  opacity: 0.72;
}

.chat-conversation-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.chat-peer {
  flex: 1 1 auto;
  color: #13365f;
  font-weight: 700;
  font-size: 14px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-peer-status {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chat-peer-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chat-peer-status.online {
  color: #0b7a61;
  border-color: rgba(62, 174, 145, 0.4);
  background: rgba(224, 248, 241, 0.9);
}

.chat-peer-status.online::before {
  background: #22b481;
  box-shadow: 0 0 0 3px rgba(34, 180, 129, 0.2);
}

.chat-peer-status.offline {
  color: #547083;
  border-color: rgba(156, 180, 194, 0.45);
  background: rgba(244, 250, 252, 0.9);
}

.chat-peer-status.offline::before {
  background: #89a0ae;
}

.chat-conversation-actions {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-conversation-top .tab-unread-badge {
  flex: 0 0 auto;
}

.chat-conversation-delete-btn {
  border: 1px solid rgba(207, 79, 79, 0.36);
  border-radius: 999px;
  background: rgba(255, 243, 243, 0.92);
  color: #ba4a4a;
  font-size: 11px;
  line-height: 1;
  padding: 3px 8px;
  cursor: pointer;
}

.chat-conversation-delete-btn:hover:not(:disabled) {
  background: rgba(255, 232, 232, 0.98);
  border-color: rgba(207, 79, 79, 0.56);
}

.chat-conversation-delete-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.chat-last-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.chat-last {
  flex: 1 1 auto;
  min-width: 0;
  color: #4b6b7e;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: visible;
  z-index: 2;
}

.chat-thread-head {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
  border-bottom: 1px solid #d5e4e0;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-thread-title-wrap {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.chat-thread-head h3 {
  margin: 0;
  font-size: 16px;
  color: #12375f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-thread-unread-badge {
  display: none;
}

.chat-thread-presence {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  line-height: 1.25;
  border: 1px solid transparent;
}

.chat-thread-presence.online {
  color: #0b7a61;
  border-color: rgba(62, 174, 145, 0.4);
  background: rgba(224, 248, 241, 0.9);
}

.chat-thread-presence.offline {
  color: #547083;
  border-color: rgba(156, 180, 194, 0.45);
  background: rgba(244, 250, 252, 0.9);
}

.chat-open-profile-btn {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  line-height: 1.2;
  color: #1f4961;
  background: rgba(246, 253, 251, 0.94);
  border: 1px solid #bad8d1;
  white-space: nowrap;
}

.chat-open-profile-btn:hover:not(:disabled) {
  background: #eff9f6;
}

.chat-bg-picker {
  position: relative;
  flex: 0 0 auto;
  z-index: 40;
}

.chat-bg-picker-btn {
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: #204a63;
  background: rgba(246, 253, 251, 0.94);
  border-color: #bad8d1;
}

.chat-bg-picker-btn:hover:not(:disabled) {
  background: #eff9f6;
}

.chat-bg-picker-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  width: min(318px, calc(100vw - 36px));
  max-height: min(64vh, 440px);
  overflow: hidden;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #c8ddd8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(15, 35, 48, 0.16);
  backdrop-filter: blur(6px);
  padding: 8px;
}

.chat-bg-picker-panel.open-upward {
  top: auto;
  bottom: calc(100% + 8px);
}

.chat-bg-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.chat-bg-opacity-control {
  flex: 0 0 auto;
  margin-top: 0;
  border-top: 1px solid #d6e5e1;
  padding-top: 8px;
  display: grid;
  gap: 6px;
}

.chat-bg-opacity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-bg-opacity-label {
  font-size: 12px;
  color: #3e5f73;
}

.chat-bg-opacity-value {
  font-size: 12px;
  font-weight: 700;
  color: #1f5a6d;
}

#chatBgOpacityInput {
  width: 100%;
  margin: 0;
  accent-color: #149284;
  touch-action: pan-x;
}

.chat-bg-option {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border: 1px solid #d3e2de;
  background: #f8fcfb;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.chat-bg-option:hover:not(:disabled) {
  border-color: #9fccbf;
  background: #eef8f4;
}

.chat-bg-option.active {
  border-color: #3fa88f;
  box-shadow: inset 0 0 0 1px rgba(63, 168, 143, 0.28);
  background: #e9f7f3;
}

.chat-bg-option-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  border: 1px solid rgba(177, 204, 198, 0.9);
  background-color: #eef6f4;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.chat-bg-option-name {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: #365b71;
  font-family: var(--font-serif);
}

.chat-back-btn {
  display: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.chat-load-more {
  flex: 0 0 auto;
  margin: 8px auto 0;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
}

.chat-message-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  position: relative;
  z-index: 1;
  padding: 10px;
  background:
    linear-gradient(0deg, var(--chat-bg-overlay), var(--chat-bg-overlay)),
    var(--chat-bg-image) center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
}

.chat-bubble-row {
  display: flex;
  flex: 0 0 auto;
}

.chat-bubble-row.mine {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(520px, 90%);
  border: 1px solid #d1e2de;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
  color: #1a3151;
  display: grid;
  gap: 3px;
}

.chat-bubble-row.mine .chat-bubble {
  border-color: #88c9bb;
  background: rgba(233, 247, 243, 0.7);
}

.chat-bubble-user {
  font-size: 11px;
  color: #527186;
}

.chat-bubble-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

.chat-bubble-time {
  font-size: 10px;
  color: #6d8797;
  text-align: right;
}

.chat-editor {
  flex: 0 0 auto;
  border-top: 1px solid #d5e4e0;
  padding: 8px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

#chatInput {
  width: 100%;
  height: 40px;
  min-height: 40px;
  max-height: 128px;
  border: 1px solid #cde0db;
  border-radius: 10px;
  padding: 8px;
  resize: none;
  line-height: 1.5;
  overflow-y: hidden;
}

#chatInput:focus {
  border-color: #83c8b9;
  box-shadow: 0 0 0 3px rgba(15, 144, 120, 0.12);
  outline: none;
}

.profile-panel {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 8px;
}

.profile-head-card {
  border: 1px solid #cde0db;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-message-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  display: inline-grid;
  place-items: center;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(245, 250, 249, 0.94);
  border: 1px solid #d5e4e0;
  color: #10213c;
  box-shadow: none;
}

.profile-message-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 21px;
  height: 21px;
  display: block;
  transform: translate(-50%, -50%);
  background: #10213c;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.54 2.46c.38.38.5.95.3 1.45l-7.25 17.38c-.2.49-.67.81-1.2.84-.53.02-1.03-.25-1.28-.72l-3.3-6.17-6.17-3.3a1.38 1.38 0 0 1 .12-2.51L20.09 2.2c.5-.2 1.07-.08 1.45.26ZM6.3 10.74l4.22 2.25c.22.12.4.3.52.52l2.25 4.22 4.8-11.53-11.8 4.54Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.54 2.46c.38.38.5.95.3 1.45l-7.25 17.38c-.2.49-.67.81-1.2.84-.53.02-1.03-.25-1.28-.72l-3.3-6.17-6.17-3.3a1.38 1.38 0 0 1 .12-2.51L20.09 2.2c.5-.2 1.07-.08 1.45.26ZM6.3 10.74l4.22 2.25c.22.12.4.3.52.52l2.25 4.22 4.8-11.53-11.8 4.54Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.profile-message-btn:hover:not(:disabled) {
  background: #eef8f4;
  border-color: #b9ddd3;
}

.profile-edit-btn {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #b8d3cb;
  background: #f4fbf9;
  color: #2c5f59;
}

.profile-edit-btn.active {
  border-color: #1b8f79;
  background: #e3f5ef;
  color: #0a6b5a;
}

.profile-head-card h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.06;
  color: #12335e;
}

.profile-meta {
  margin: 0;
  color: #4d6b7f;
  font-size: 12px;
  line-height: 1.35;
}

.profile-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #1c3f64;
  font-size: 12px;
  margin-bottom: 0;
  padding: 0 2px;
}

.profile-pages {
  min-height: 0;
  height: auto;
  overflow: visible;
  position: relative;
}

.profile-page {
  min-height: 0;
  height: auto;
}

.profile-page.hidden {
  display: none;
}

.profile-page-garden {
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
}

.profile-page-settings {
  overflow: visible;
  padding-right: 2px;
}

.profile-settings-card {
  border: 1px solid #c9dfd9;
  border-radius: 14px;
  background:
    radial-gradient(circle at 85% 16%, rgba(255, 255, 255, 0.74) 0%, transparent 44%),
    linear-gradient(150deg, rgba(242, 251, 247, 0.88) 0%, rgba(229, 245, 238, 0.9) 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.profile-settings-card.hidden {
  display: none;
}

.profile-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.profile-settings-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  color: #16375f;
}

.profile-settings-head p {
  margin: 4px 0 0;
  color: #4f7183;
  font-size: 12px;
}

.profile-settings-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #b8d8cf;
  background: rgba(255, 255, 255, 0.75);
  color: #356b62;
  font-size: 11px;
  letter-spacing: 0.08em;
}

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

.profile-setting-field {
  display: grid;
  gap: 6px;
  color: #3c5e74;
  font-size: 12px;
}

.profile-setting-field > span {
  font-family: var(--font-serif);
}

.profile-setting-readonly {
  align-content: end;
}

.profile-email-verify-field {
  grid-column: 1 / -1;
}

.profile-email-verify-card {
  border: 1px solid #c8ddd8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.profile-email-verify-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-email-verify-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d0ded9;
  background: rgba(246, 251, 249, 0.92);
  color: #4e6f7f;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-email-verify-status.is-verified {
  border-color: rgba(26, 137, 92, 0.36);
  background: rgba(229, 248, 240, 0.96);
  color: #17714e;
}

.profile-email-verify-status.is-unverified {
  border-color: rgba(196, 147, 67, 0.38);
  background: rgba(255, 245, 229, 0.94);
  color: #8e5a18;
}

.profile-email-verify-status.is-empty {
  border-color: rgba(146, 172, 186, 0.34);
  background: rgba(240, 246, 249, 0.92);
  color: #507088;
}

.profile-email-verify-time {
  font-size: 12px;
  color: #5a7687;
}

.profile-email-verify-hint {
  margin: 0;
  font-size: 12px;
  color: #4f7081;
  line-height: 1.45;
}

.profile-email-verify-hint.error {
  color: #bf4f4f;
}

.profile-email-verify-hint.success {
  color: #157f60;
}

.profile-email-verify-actions {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) 126px;
  gap: 8px;
}

.profile-email-verify-actions .mode-btn,
.profile-email-verify-actions .primary {
  height: 40px;
  min-height: 40px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
}

.profile-email-verify-actions input {
  width: 100%;
  border: 1px solid #c6ddd7;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  color: #14314d;
  background: rgba(255, 255, 255, 0.88);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.profile-email-verify-actions input:focus {
  border-color: #71bdad;
  box-shadow: 0 0 0 3px rgba(18, 146, 121, 0.14);
  background: #ffffff;
}

.profile-email-verify-actions input:disabled {
  background: rgba(240, 247, 245, 0.84);
}

.profile-readonly-value {
  min-height: 40px;
  border: 1px solid #c6ddd7;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  color: #2f4e63;
  background: rgba(240, 248, 245, 0.86);
  display: inline-flex;
  align-items: center;
}

.profile-setting-field input {
  width: 100%;
  border: 1px solid #c6ddd7;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  color: #14314d;
  background: rgba(255, 255, 255, 0.84);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.profile-setting-field input:focus {
  border-color: #71bdad;
  box-shadow: 0 0 0 3px rgba(18, 146, 121, 0.14);
  background: #ffffff;
}

.profile-gender-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-gender-option {
  position: relative;
  border: 1px solid #c9ddd8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: #2d5468;
  font-size: 13px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.profile-gender-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-gender-option:hover {
  border-color: #8bc9bb;
}

.profile-gender-option:has(input:checked) {
  border-color: #14937c;
  background: linear-gradient(135deg, #e7f7f2 0%, #def4ee 100%);
  color: #0f6758;
  box-shadow: 0 8px 18px rgba(20, 147, 124, 0.12);
}

.profile-notify-toggle {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #c8ded8;
  background: rgba(255, 255, 255, 0.74);
  color: #2f5664;
  cursor: pointer;
  user-select: none;
}

.profile-notify-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #b4d0c9;
  background: #eaf3f0;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.toggle-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(14, 39, 50, 0.2);
  transition: transform 0.2s ease;
}

.profile-notify-toggle input:checked + .toggle-track {
  background: #d8f3eb;
  border-color: #16947d;
}

.profile-notify-toggle input:checked + .toggle-track .toggle-dot {
  transform: translateX(22px);
}

.toggle-text {
  font-size: 13px;
  line-height: 1.35;
}

.profile-settings-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-settings-hint {
  margin: 0;
  font-size: 12px;
  color: #567688;
}

.profile-settings-hint.error {
  color: #bf4f4f;
}

.profile-settings-hint.success {
  color: #157f60;
}

.profile-settings-foot .primary {
  min-width: 112px;
  padding: 8px 14px;
}

.profile-entry-grid {
  min-height: 0;
  overflow: visible;
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 2px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.profile-entry-card {
  position: relative;
  border: 1px solid #cfe2dd;
  border-radius: 12px;
  background: #fbfefd;
  padding: 8px;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.profile-panel.profile-editing .profile-entry-card {
  cursor: grab;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
  will-change: transform;
  transform-origin: 50% 60%;
}

.profile-panel.profile-editing .profile-entry-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(13, 47, 60, 0.12);
}

.profile-panel.profile-editing .profile-entry-card:active {
  cursor: grabbing;
}

.profile-entry-card.profile-entry-dragging {
  opacity: 1;
  z-index: 5;
  box-shadow: 0 16px 28px rgba(13, 47, 60, 0.22);
  animation: none !important;
}

.profile-entry-placeholder {
  width: 100%;
  border: 1px dashed rgba(94, 164, 150, 0.65);
  border-radius: 12px;
  background: rgba(223, 243, 238, 0.6);
}

.profile-entry-grid.is-dragging .profile-entry-card:not(.profile-entry-dragging) > * {
  animation: profile-jiggle 0.72s ease-in-out infinite;
}

.profile-entry-grid.is-dragging .profile-entry-card:nth-child(2n):not(.profile-entry-dragging) > * {
  animation-delay: -0.08s;
}

.profile-entry-grid.is-dragging .profile-entry-card:nth-child(3n):not(.profile-entry-dragging) > * {
  animation-delay: -0.16s;
}

.profile-entry-grid.is-dragging .profile-entry-card:nth-child(4n):not(.profile-entry-dragging) > * {
  animation-delay: -0.24s;
}

@keyframes profile-jiggle {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-0.8px) rotate(-0.55deg);
  }
  50% {
    transform: translateY(0px) rotate(0.35deg);
  }
  75% {
    transform: translateY(0.7px) rotate(0.55deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.profile-entry-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  border: 1px solid rgba(207, 79, 79, 0.42);
  background: rgba(255, 241, 241, 0.94);
  color: #b04646;
  box-shadow: 0 6px 12px rgba(144, 63, 63, 0.12);
}

.profile-entry-delete-btn:hover:not(:disabled) {
  background: rgba(254, 227, 227, 0.98);
  border-color: rgba(207, 79, 79, 0.58);
}

.profile-entry-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid #d4e4df;
  border-radius: 10px;
  background: #f8fcfb;
}

.profile-entry-title {
  font-family: var(--font-serif);
  color: #173b63;
  font-size: 17px;
}

.profile-entry-desc {
  color: #45677d;
  font-size: 12px;
  line-height: 1.4;
  min-height: 32px;
}

.profile-entry-meta {
  color: #547284;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.profile-entry-meta-time,
.profile-entry-meta-social {
  white-space: nowrap;
}

.panel-hint {
  margin: 0;
  color: #537284;
  font-size: 12px;
}

#profileMoreHint {
  width: 100%;
  grid-column: 1 / -1;
  text-align: center;
}

.profile-grid-hint {
  padding: 2px 0 4px;
  color: #6f8898;
  font-size: 12px;
}

.inline-user-link {
  border: none;
  background: transparent;
  color: #2d6f89;
  cursor: pointer;
  text-decoration: none;
}

.inline-user-link:hover {
  color: #0f7e6a;
  text-decoration: underline;
}

.user-presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  line-height: 1.45;
  border: 1px solid transparent;
  vertical-align: middle;
  white-space: nowrap;
}

.user-presence-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.user-presence-badge.online {
  color: #0f7a63;
  border-color: rgba(66, 178, 149, 0.45);
  background: rgba(229, 248, 243, 0.88);
}

.user-presence-badge.online::before {
  background: #2ab88a;
  box-shadow: 0 0 0 3px rgba(42, 184, 138, 0.18);
}

.user-presence-badge.offline {
  color: #4f6c80;
  border-color: rgba(164, 187, 199, 0.48);
  background: rgba(244, 250, 252, 0.92);
}

.user-presence-badge.offline::before {
  background: #8da5b3;
}

.mobile-tabs {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 980;
  border: 1px solid #bfd7d1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(12, 38, 48, 0.12);
  padding: 4px;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.mobile-tab {
  position: relative;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #2b4f65;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mobile-tab.active {
  background: #e9f7f3;
  border-color: #b8ddd4;
  color: #0f5f53;
}

.mobile-tab-icon {
  width: 24px;
  height: 24px;
  display: block;
  pointer-events: none;
}

.mobile-tab .tab-unread-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  margin-left: 0;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  font-size: 10px;
  padding: 0 4px;
  z-index: 1;
}

.zoo-stage-wrap {
  position: relative;
  border: 1px solid rgba(190, 211, 204, 0.84);
  border-radius: 18px;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.72) 0%, transparent 36%),
    radial-gradient(circle at 86% 22%, rgba(189, 228, 218, 0.42) 0%, transparent 40%),
    linear-gradient(160deg, #eff9f5 0%, #e0f0eb 58%, #d5e8e2 100%);
}

#zooStage {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: min(760px, calc(100% - 18px));
  border: 1px solid rgba(188, 213, 208, 0.86);
  border-radius: 999px;
  background: rgba(252, 255, 254, 0.88);
  color: #35596d;
  font-family: var(--font-serif);
  font-size: 14px;
  text-align: center;
  line-height: 1.45;
  padding: 8px 15px;
  pointer-events: none;
}

.stage-stats-card {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 4;
  min-width: 128px;
  padding: 7px 9px;
  border: 1px solid rgba(177, 205, 212, 0.9);
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.14) 56%, transparent 76%),
    linear-gradient(145deg, rgba(241, 251, 250, 0.86) 0%, rgba(222, 242, 243, 0.86) 100%);
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 24px rgba(16, 47, 63, 0.14);
  pointer-events: none;
}

.stage-display-control {
  position: absolute;
  top: 84px;
  right: 12px;
  z-index: 4;
  width: 160px;
  padding: 6px 8px 6px;
  border: 1px solid rgba(169, 194, 207, 0.9);
  border-radius: 11px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.12) 58%, transparent 78%),
    linear-gradient(146deg, rgba(242, 250, 251, 0.9) 0%, rgba(224, 240, 245, 0.9) 100%);
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 22px rgba(16, 47, 63, 0.12);
}

.stage-display-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.stage-display-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-display-label {
  font-size: 10px;
  line-height: 1.2;
  color: #3d6072;
}

.stage-display-value {
  font-family: var(--font-serif);
  font-size: 13px;
  color: #123e5d;
  font-weight: 700;
}

.stage-refresh-btn {
  border: 1px solid #8bc9bf;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #165f57;
  font-size: 10px;
  line-height: 1;
  padding: 5px 8px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.stage-refresh-btn:hover {
  background: #42b39f;
  border-color: #42b39f;
  color: #ffffff;
}

.stage-refresh-btn:active {
  background: #2f9583;
  border-color: #2f9583;
  color: #ffffff;
}

#stageDisplayCountInput {
  width: 100%;
  margin: 0;
  accent-color: #149284;
}

.stage-stats-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.stage-stats-row + .stage-stats-row {
  margin-top: 4px;
}

.stage-stats-label {
  font-size: 11px;
  line-height: 1.2;
  color: #466577;
  letter-spacing: 0.02em;
}

.stage-stats-value {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.1;
  font-weight: 700;
  color: #153d5a;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 34, 0.44);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: clamp(10px, 2.5vh, 20px) 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#animalModalBackdrop {
  z-index: 1000;
}

#commentsBackdrop {
  z-index: 1100;
}

.modal-backdrop.hidden {
  display: none;
}

.page-notice {
  position: fixed;
  top: max(12px, calc(env(safe-area-inset-top) + 8px));
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 20px));
  z-index: 1300;
  pointer-events: none;
}

.page-notice.hidden {
  display: none;
}

.page-notice-card {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(57, 123, 118, 0.34);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.08) 52%, transparent 72%),
    linear-gradient(135deg, rgba(229, 247, 241, 0.95) 0%, rgba(213, 237, 236, 0.95) 100%);
  box-shadow: 0 14px 34px rgba(11, 41, 59, 0.28);
  backdrop-filter: blur(5px);
  animation: page-notice-in 0.22s ease;
}

.page-notice-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #0f5f56;
  background: rgba(231, 251, 245, 0.88);
  border: 1px solid rgba(63, 145, 125, 0.42);
}

.page-notice-copy {
  min-width: 0;
}

.page-notice-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-family: var(--font-serif);
  color: #123252;
}

.page-notice-text {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #254a64;
  word-break: break-word;
}

.page-notice-close {
  border: 1px solid #afd7ce;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.68);
  color: #20586f;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.page-notice.notice-success .page-notice-card {
  border-color: rgba(42, 144, 108, 0.5);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.08) 52%, transparent 72%),
    linear-gradient(135deg, rgba(227, 248, 239, 0.95) 0%, rgba(200, 235, 224, 0.95) 100%);
}

.page-notice.notice-success .page-notice-icon {
  color: #157a55;
  border-color: rgba(29, 146, 99, 0.4);
  background: rgba(233, 253, 244, 0.92);
}

.page-notice.notice-error .page-notice-card {
  border-color: rgba(174, 74, 74, 0.44);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.08) 52%, transparent 72%),
    linear-gradient(135deg, rgba(254, 236, 236, 0.96) 0%, rgba(246, 216, 216, 0.96) 100%);
}

.page-notice.notice-error .page-notice-icon {
  color: #a24545;
  border-color: rgba(184, 77, 77, 0.42);
  background: rgba(255, 241, 241, 0.92);
}

.confirm-modal {
  width: min(460px, 96vw);
  border-radius: 18px;
  border: 1px solid rgba(57, 123, 118, 0.34);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.08) 52%, transparent 72%),
    linear-gradient(135deg, rgba(229, 247, 241, 0.95) 0%, rgba(213, 237, 236, 0.95) 100%);
  box-shadow: 0 24px 42px rgba(16, 34, 47, 0.24);
  backdrop-filter: blur(6px);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.confirm-modal.danger {
  border-color: rgba(174, 74, 74, 0.42);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.08) 52%, transparent 72%),
    linear-gradient(135deg, rgba(254, 236, 236, 0.96) 0%, rgba(246, 216, 216, 0.96) 100%);
}

.confirm-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.confirm-modal-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  color: #123252;
}

.confirm-modal-text {
  margin: 0;
  color: #274a64;
  line-height: 1.65;
  white-space: pre-wrap;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-modal-actions button {
  min-width: 88px;
}

@keyframes page-notice-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.composer-card {
  width: min(480px, 100%);
  max-height: min(86vh, 760px);
  border: 1px solid #c8ddd8;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 40px rgba(18, 41, 52, 0.22);
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
}

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

.composer-head h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: #112449;
}

.composer-head p {
  margin-top: 5px;
  color: #4e6479;
  line-height: 1.5;
  font-size: 14px;
}



.composer-canvas-wrap {
  border: 1px solid #d0e2de;
  border-radius: 14px;
  padding: 8px;
  background: linear-gradient(180deg, #f8fcfb 0%, #f3faf8 100%);
}

#drawCanvas {
  display: block;
  width: 100%;
  max-width: 286px;
  margin: 0 auto;
  height: auto;
  border: 1px dashed #a8cdc5;
  border-radius: 12px;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

.draw-tools-row {
  display: grid;
  gap: 8px;
}

.draw-tools-label {
  font-size: 13px;
  color: #476173;
  font-family: var(--font-serif);
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-chip {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid #d9e6e2;
  background: var(--chip-color, #101a38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.color-chip:hover:not(:disabled) {
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 4px 10px rgba(16, 36, 45, 0.18);
}

.color-chip.active {
  border-color: #1f8f79;
  box-shadow: 0 0 0 2px rgba(31, 143, 121, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.95);
}

.composer-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compose-status,
#pickHint {
  font-family: var(--font-serif);
  font-size: 14px;
  color: #405f72;
  line-height: 1.6;
}

.compose-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 174px;
  overflow: auto;
}

.attitude-editor {
  display: grid;
  gap: 6px;
}

.attitude-editor label {
  font-size: 13px;
  color: #476173;
  font-family: var(--font-serif);
}

#attitudeInput {
  border: 1px solid #cbded9;
  border-radius: 10px;
  padding: 9px 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: #18304b;
  background: #fbfefd;
}

#attitudeInput:focus {
  outline: none;
  border-color: #19917a;
  box-shadow: 0 0 0 3px rgba(25, 145, 122, 0.14);
  background: #ffffff;
}

.compose-result-item {
  border: 1px solid #d1e1dd;
  border-radius: 12px;
  background: #fbfefd;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 9px;
  align-items: center;
}

.compose-result-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.compose-rank {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 9px;
  background: #e6f5f1;
  color: #256c61;
  font-size: 12px;
}

.compose-name {
  font-family: var(--font-serif);
  font-size: 18px;
  color: #0f294f;
}

.compose-score {
  color: #3f6176;
  font-size: 13px;
  line-height: 1.45;
}

.score-highlight {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(15, 144, 120, 0.12);
  border: 1px solid rgba(15, 144, 120, 0.28);
  color: #0b755f;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.composer-submit {
  border-top: 1px solid #d4e2df;
  padding-top: 11px;
  display: grid;
  gap: 8px;
}

.animal-modal {
  position: relative;
  width: min(620px, 100%);
  border-radius: 20px;
  border: 1px solid #caded8;
  background:
    linear-gradient(0deg, var(--animal-modal-overlay), var(--animal-modal-overlay)),
    var(--animal-modal-crop-url) var(--animal-modal-bg-pos-x) var(--animal-modal-bg-pos-y) / var(--animal-modal-bg-size-x) var(--animal-modal-bg-size-y) no-repeat;
  box-shadow: 0 24px 44px rgba(16, 35, 48, 0.2);
  padding: 18px;
}

.animal-modal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
}

.animal-preview-wrap {
  border: 1px solid #d1e1de;
  border-radius: 14px;
  background: rgba(249, 253, 252, 0.26);
  padding: 8px;
}

.animal-info {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 8px 10px;
}

.animal-preview-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 10px;
  background: transparent;
}

.animal-info h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: #102345;
}

.info-line {
  margin-top: 8px;
  color: #3e5f73;
  line-height: 1.6;
  font-size: 15px;
}

.info-attitude {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(209, 226, 221, 0.82);
  border-radius: 10px;
  background: rgba(248, 252, 251, 0.62);
  color: #1f4a65;
  white-space: pre-wrap;
}

.animal-social-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.animal-social-btn {
  border-radius: 999px;
  padding: 7px 12px;
  min-width: 0;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.animal-social-btn .action-icon {
  font-weight: 700;
}

.animal-social-btn .action-count {
  font-weight: 700;
}

.info-tip {
  margin-top: 12px;
  border-top: 1px solid #d4e1dd;
  padding-top: 10px;
  color: #537486;
  font-size: 14px;
  line-height: 1.55;
}

.icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #cdded9;
  background: #ffffff;
  color: #315a64;
  cursor: pointer;
  font-size: 24px;
  font-family: "Segoe UI Symbol", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
  line-height: 1;
}

.icon-btn.hidden {
  display: none;
}

.animal-close {
  position: absolute;
  right: 10px;
  top: 10px;
}

button {
  border: 1px solid #bfd6d1;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 14px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-ui);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(16, 36, 45, 0.1);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.primary,
#joinBtn {
  border-color: transparent;
  background: linear-gradient(135deg, #0f9078 0%, #22aa8f 100%);
  color: #ffffff;
}

button.primary:hover:not(:disabled),
#joinBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0a7d67 0%, #1b967f 100%);
}

.logout-btn {
  border-color: #e0cdcd;
  color: #8d3f3f;
}

.choice-btn {
  border-radius: 999px;
  min-width: 74px;
}

.choice-btn.active {
  border-color: transparent;
  background: #d9f5ee;
  color: #07584d;
}

#eraserBtn.active {
  border-color: transparent;
  background: linear-gradient(135deg, #ef6b6b 0%, #de4f4f 100%);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(203, 68, 68, 0.28);
}

#fillBtn.active {
  border-color: transparent;
  background: linear-gradient(135deg, #2b9ad0 0%, #1b7fbf 100%);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(36, 118, 181, 0.26);
}


.zoo-feed-dock {
  position: absolute;
  right: 14px;
  top: 14px;
  width: min(340px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  border: 1px solid rgba(179, 204, 198, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  box-shadow: 0 14px 28px rgba(14, 34, 45, 0.12);
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.zoo-feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.zoo-feed-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  color: #102345;
  font-size: 22px;
}

.feed-tip {
  color: #4b6a7f;
  font-size: 12px;
}

.feed-cards {
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 2px;
}

.feed-empty {
  border: 1px dashed #bdd5cf;
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  color: #567181;
  font-size: 14px;
  background: #f8fcfb;
}

.feed-card {
  border: 1px solid #d0e2de;
  border-radius: 14px;
  background: #fbfefd;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.feed-card-top {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  cursor: pointer;
  border-radius: 10px;
  outline: none;
}

.feed-card-top:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 144, 120, 0.24);
}

.feed-preview {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid #cfe0dc;
  background: linear-gradient(180deg, #f9fdfc 0%, #f0f8f5 100%);
  object-fit: contain;
}

.feed-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.feed-animal {
  font-family: var(--font-serif);
  color: #0f294f;
  font-size: 18px;
  line-height: 1.25;
}

.feed-owner,
.feed-time {
  color: #4e687b;
  font-size: 12px;
  line-height: 1.35;
}

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

.feed-action-btn {
  border-radius: 999px;
  padding: 6px 10px;
  min-width: 0;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.feed-action-btn .action-icon {
  font-weight: 700;
}

.feed-action-btn .action-count {
  font-weight: 700;
}

.like-btn.liked {
  border-color: rgba(223, 85, 85, 0.5);
  color: #c74242;
  background: rgba(255, 232, 232, 0.9);
}

.comments-panel {
  width: min(760px, 96vw);
  max-height: min(84vh, 860px);
  border: 1px solid #c9ddd8;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 42px rgba(16, 34, 47, 0.22);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.comments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #d6e4e0;
  background: linear-gradient(180deg, #fafdfe 0%, #f3f9f7 100%);
}

.comments-head h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 24px;
  color: #112449;
}

.comments-title-main {
  color: #112449;
}

.comments-title-count {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: #6f8799;
}

.comments-list {
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #ffffff;
}

.comments-empty {
  border: 1px dashed #c6dbd6;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: #577082;
  background: #f8fcfb;
}

.comment-item {
  display: grid;
  gap: 8px;
}

.comment-main {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d8efea 0%, #bde5dc 100%);
  border: 1px solid #a7cec5;
  color: #0f6c5d;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.comment-body {
  display: grid;
  gap: 4px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #557287;
  font-size: 12px;
}

.comment-user {
  color: #18345d;
  font-weight: 700;
}

.comment-content {
  white-space: pre-wrap;
  color: #1b304f;
  line-height: 1.6;
  font-size: 14px;
}

.comment-tools {
  display: flex;
  gap: 8px;
}

.comment-tool-btn {
  border: none;
  background: transparent;
  color: #3e6b84;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
}

.comment-tool-btn:hover {
  color: #0f7e6a;
  text-decoration: underline;
}

.comment-replies {
  margin-left: 50px;
  border-left: 2px solid #e1eeea;
  padding-left: 10px;
  display: grid;
  gap: 10px;
}

.comment-replies-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.comment-replies-btn {
  border: none;
  background: transparent;
  color: #2f6b86;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
}

.comment-replies-btn:hover:not(:disabled) {
  color: #0f7e6a;
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.comment-replies-page {
  color: #5b7688;
  font-size: 12px;
}

.comment-loading-more {
  border: 1px dashed #c7ddd8;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  color: #597486;
  font-size: 12px;
  background: #f7fcfb;
}

.comment-editor {
  border-top: 1px solid #d6e4e0;
  background: #f9fdfc;
  padding: 10px 14px 12px;
  display: grid;
  gap: 8px;
}

.reply-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #3f6b81;
  font-size: 12px;
  border: 1px dashed #bfd8d2;
  border-radius: 10px;
  padding: 6px 8px;
  background: #f3faf7;
}

.reply-hint.hidden {
  display: none;
}

.reply-cancel {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

#commentInput {
  width: 100%;
  min-height: 84px;
  max-height: 190px;
  border: 1px solid #cde0db;
  border-radius: 12px;
  resize: vertical;
  padding: 10px;
  font-family: var(--font-ui);
  color: #1a3152;
  background: #ffffff;
  outline: none;
}

@media (min-width: 861px) {
  .comment-editor {
    padding: 8px 14px 10px;
    gap: 6px;
  }

  #commentInput {
    min-height: 42px;
    height: 42px;
    max-height: 150px;
    resize: none;
    overflow-y: hidden;
    line-height: 1.45;
    padding: 9px 10px;
  }
}

#commentInput:focus {
  border-color: #83c8b9;
  box-shadow: 0 0 0 3px rgba(15, 144, 120, 0.12);
}

.comment-editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-limit {
  color: #5a7688;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .zoo-feed-dock {
    width: min(300px, calc(100% - 28px));
  }
}

@media (max-width: 860px) {
  .top-tabs {
    display: none;
  }

  .mobile-tabs {
    display: grid;
  }

  .zoo-page {
    padding-bottom: 62px;
  }

  .panel-card {
    min-height: clamp(320px, calc(100vh - 250px), 720px);
    min-height: clamp(320px, calc(100dvh - 250px), 720px);
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-conversation-pane {
    display: block;
  }

  .chat-panel.mobile-thread-open .chat-conversation-pane {
    display: none;
  }

  .chat-panel.mobile-thread-open .chat-thread-pane {
    display: flex;
  }

  .chat-thread-pane {
    display: none;
    min-height: 0;
  }

  .chat-back-btn {
    display: inline-flex;
  }

  .chat-bg-picker-btn {
    padding: 4px 9px;
    font-size: 11px;
  }

  .chat-open-profile-btn {
    padding: 4px 9px;
    font-size: 11px;
  }

  .chat-bg-picker-panel {
    right: 0;
    width: min(300px, calc(100vw - 26px));
  }

  .chat-bg-picker-list {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .profile-entry-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-settings-form {
    grid-template-columns: 1fr;
  }

  .profile-email-verify-actions {
    grid-template-columns: 1fr;
  }

  .profile-email-verify-actions .mode-btn,
  .profile-email-verify-actions .primary {
    width: 100%;
  }

  .profile-gender-options {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .profile-settings-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-settings-foot .primary {
    width: 100%;
  }

  .zoo-feed-dock {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-height: 46%;
  }

  .feed-cards {
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .comments-panel {
    width: 100%;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
  }

  #commentsBackdrop {
    padding: 0;
    align-items: flex-end;
  }

  .comments-list {
    padding: 10px;
  }

  .comment-main {
    grid-template-columns: 34px 1fr;
  }

  .comment-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .comment-replies {
    margin-left: 12px;
    padding-left: 8px;
  }
}
@media (max-width: 1120px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: 440px;
  }

  .gender-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .zoo-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 7px 10px;
  }

  .zoo-actions {
    width: 100%;
  }

  .current-user-menu {
    width: 100%;
  }

  .current-user-dropdown {
    left: 0;
    right: 0;
    width: auto;
  }

  #zooStage {
    min-height: 0;
  }

  .animal-modal-body {
    grid-template-columns: 1fr;
  }

  .animal-preview-wrap {
    max-width: 280px;
  }
}

@media (max-width: 760px) {
  .stage-stats-card {
    top: 8px;
    right: 8px;
    min-width: 108px;
    padding: 6px 8px;
    border-radius: 10px;
  }

  .stage-display-control {
    top: 68px;
    right: 8px;
    width: 140px;
    padding: 6px 7px 5px;
    border-radius: 10px;
  }

  .stage-display-label {
    font-size: 9px;
  }

  .stage-display-value {
    font-size: 12px;
  }

  .stage-refresh-btn {
    font-size: 9px;
    padding: 4px 7px;
  }

  .stage-stats-label {
    font-size: 10px;
  }

  .stage-stats-value {
    font-size: 13px;
  }

  .page-notice {
    width: calc(100vw - 14px);
    top: max(8px, calc(env(safe-area-inset-top) + 6px));
  }

  .page-notice-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px;
  }

  .page-notice-close {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: -2px;
  }

  .panel-card {
    min-height: clamp(280px, calc(100vh - 300px), 620px);
    min-height: clamp(280px, calc(100dvh - 300px), 620px);
    padding: 10px;
  }

  .panel-head h2 {
    font-size: 24px;
  }

  .profile-head-card {
    padding: 7px 10px;
    gap: 6px;
  }

  .profile-head-card h2 {
    font-size: 19px;
    line-height: 1.08;
  }

  .profile-meta {
    font-size: 11px;
  }

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

  .profile-entry-meta {
    display: grid;
    gap: 2px;
    align-items: start;
  }

  .mailbox-panel {
    background-position: 68% center;
    gap: 10px;
  }

  .mailbox-letter-card {
    padding: 8px 8px 0;
    border: 1px solid rgba(186, 214, 208, 0.7);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 251, 250, 0.62));
    backdrop-filter: blur(2px);
    max-height: min(52vh, 560px);
    overflow: auto;
  }

  .mailbox-letter-card::before {
    left: 5px;
    top: 6px;
    font-size: 24px;
    color: rgba(20, 77, 106, 0.16);
  }

  .mailbox-letter-card::after {
    left: 12px;
    top: 24px;
    bottom: 12px;
    width: 1px;
    background: linear-gradient(180deg, rgba(53, 135, 118, 0.24) 0%, rgba(53, 135, 118, 0.04) 100%);
  }

  .mailbox-letter-text {
    padding: 4px 0 2px 18px;
    gap: 10px;
  }

  .mailbox-letter-line {
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.005em;
  }

  .mailbox-entry-cta {
    grid-template-columns: 1fr;
    padding: 4px 2px 0;
    gap: 9px;
  }

  .mailbox-entry-lead {
    font-size: 13px;
    line-height: 1.55;
  }

  .mailbox-entry-cta #openMailboxFormBtn {
    justify-self: start;
    margin-right: 0;
  }

  .auth-body {
    padding: 12px;
  }

  .auth-layout {
    border-radius: 20px;
    min-height: auto;
  }

  .auth-story {
    padding: 24px 18px;
    gap: 14px;
  }

  .auth-story h1 {
    font-size: 30px;
  }

  .story-prose p {
    font-size: 15px;
    line-height: 1.95;
  }

  .auth-panel {
    padding: 14px;
  }

  .auth-card {
    padding: 18px;
    border-radius: 16px;
  }

  .zoo-shell {
    padding: 8px;
    gap: 8px;
  }

  .zoo-brand-main {
    font-size: 20px;
  }

  .current-user {
    width: 100%;
    justify-content: center;
  }

  .current-user-name {
    max-width: 100%;
  }

  .zoo-actions > button,
  .zoo-actions > .current-user-menu {
    flex: 1;
  }

  #zooStage {
    min-height: 0;
  }

  .stage-hint {
    border-radius: 12px;
    bottom: 10px;
  }

  .composer-card {
    width: 100%;
    max-height: min(90vh, 720px);
    padding: 10px;
  }

  .composer-head h2 {
    font-size: 24px;
  }

  .compose-result-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .choice-btn {
    align-self: flex-end;
  }
}

@media (max-width: 860px) {
  :root {
    --mobile-tabbar-height: 58px;
    --mobile-page-gap: 7px;
  }

  .zoo-page {
    height: var(--app-viewport-height, 100svh);
    min-height: var(--app-viewport-height, 100svh);
    padding-bottom: 0;
    background: linear-gradient(180deg, #f8fcfb 0%, #eef7f4 100%);
  }

  .zoo-shell {
    height: var(--app-viewport-height, 100svh);
    min-height: var(--app-viewport-height, 100svh);
    padding: max(6px, env(safe-area-inset-top)) 6px calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px) + 8px);
    gap: var(--mobile-page-gap);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .zoo-page[data-active-tab="zoo"] .zoo-shell {
    padding-bottom: max(6px, calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px)));
  }

  .zoo-page.mobile-chat-thread-open .zoo-shell {
    padding-bottom: max(7px, calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px)));
  }

  .zoo-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border-radius: 16px;
  }

  .zoo-brand {
    min-width: 0;
    gap: 1px;
  }

  .zoo-brand-main {
    font-size: clamp(21px, 5.8vw, 26px);
    line-height: 1;
    white-space: nowrap;
  }

  .zoo-brand-sub {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .zoo-actions {
    justify-self: end;
    width: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    align-items: stretch;
  }

  .current-user-menu {
    width: auto;
    min-width: 0;
    order: 2;
  }

  .current-user {
    width: auto;
    min-width: 46px;
    min-height: 42px;
    justify-content: flex-start;
    gap: 4px;
    padding: 5px 7px;
    border-radius: 999px;
  }

  .current-user-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    font-size: 15px;
  }

  .current-user-content {
    font-size: 10px;
    line-height: 1.05;
    display: none;
  }

  .current-user-label {
    display: none;
  }

  .current-user-name {
    display: none;
  }

  .current-user-caret {
    margin-left: 0;
    font-size: 12px;
  }

  .zoo-actions > button,
  .zoo-actions > .current-user-menu {
    flex: none;
  }

  #openComposerBtn {
    order: 1;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    white-space: nowrap;
    display: inline-grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(15, 144, 120, 0.18);
  }

  #openComposerBtn::before {
    content: "+";
    font-size: 32px;
    line-height: 1;
    font-weight: 900;
    margin-right: 3px;
  }

  #openComposerBtn::after {
    content: "";
    display: none;
  }

  #logoutBtn {
    display: none;
  }

  .current-user-dropdown {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 62px);
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }

  .zoo-main-shell,
  .tab-view,
  .panel-card {
    min-height: 0;
  }

  .panel-card {
    height: 100%;
    min-height: 0;
    border-radius: 18px;
    padding: 10px;
  }

  .chat-panel {
    padding: 0;
    overflow: hidden;
    background:
      radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.82), transparent 42%),
      linear-gradient(145deg, rgba(242, 251, 248, 0.92), rgba(224, 240, 236, 0.92));
  }

  .chat-layout {
    height: 100%;
    min-height: 0;
    gap: 0;
    overflow: hidden;
  }

  .chat-conversation-pane,
  .chat-thread-pane {
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
  }

  .chat-conversation-list {
    padding: 10px;
    gap: 8px;
  }

  .chat-conversation-item {
    height: 86px;
    min-height: 86px;
    border-radius: 16px;
    padding: 10px 11px;
    background: rgba(250, 254, 253, 0.92);
  }

  .chat-thread-pane {
    overflow: hidden;
  }

  .chat-thread-head {
    display: grid;
    grid-template-columns: 28px auto minmax(0, 1fr) auto auto;
    grid-template-areas: "back unread title profile bg";
    align-items: center;
    gap: 6px;
    min-height: 52px;
    padding: 6px 9px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(247, 253, 251, 0.86));
    backdrop-filter: blur(8px);
  }

  .chat-back-btn {
    grid-area: back;
    width: 30px;
    height: 40px;
    min-width: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    white-space: nowrap;
    color: transparent;
    position: relative;
  }

  .chat-back-btn:hover:not(:disabled) {
    background: transparent;
    box-shadow: none;
  }

  .chat-back-btn::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 13px;
    height: 13px;
    border-left: 3.5px solid #12375f;
    border-bottom: 3.5px solid #12375f;
    border-radius: 2px;
    transform: translateY(-50%) rotate(45deg);
    transform-origin: center;
  }

  .chat-thread-unread-badge {
    grid-area: unread;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    border: 1px solid rgba(209, 73, 73, 0.46);
    background: linear-gradient(180deg, rgba(255, 239, 239, 0.98), rgba(251, 221, 221, 0.98));
    color: #b93535;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
  }

  .chat-thread-title-wrap {
    grid-area: title;
    min-width: 0;
    gap: 3px;
    align-self: center;
  }

  .chat-thread-head h3 {
    font-size: clamp(18px, 4.8vw, 23px);
    letter-spacing: 0.01em;
    line-height: 1.05;
  }

  .chat-thread-presence {
    font-size: 11px;
    padding: 2px 8px;
  }

  .chat-open-profile-btn {
    grid-area: profile;
    justify-self: end;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    position: relative;
    aspect-ratio: 1 / 1;
  }

  .chat-open-profile-btn::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    display: block;
    background: #214b62;
    transform: translate(-50%, -50%);
    -webkit-mask: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4.1 4.1 10.8a1.15 1.15 0 0 0 1.48 1.76l.42-.35v6.15A1.65 1.65 0 0 0 7.65 20h8.7A1.65 1.65 0 0 0 18 18.35V12.2l.42.35a1.15 1.15 0 1 0 1.48-1.76L12 4.1Zm0 2.75 3.72 3.15v7.7h-2.18v-3.56a1.54 1.54 0 0 0-3.08 0v3.56H8.28V10L12 6.85Z'/%3E%3C/svg%3E") center center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4.1 4.1 10.8a1.15 1.15 0 0 0 1.48 1.76l.42-.35v6.15A1.65 1.65 0 0 0 7.65 20h8.7A1.65 1.65 0 0 0 18 18.35V12.2l.42.35a1.15 1.15 0 1 0 1.48-1.76L12 4.1Zm0 2.75 3.72 3.15v7.7h-2.18v-3.56a1.54 1.54 0 0 0-3.08 0v3.56H8.28V10L12 6.85Z'/%3E%3C/svg%3E") center center / contain no-repeat;
  }

  .chat-bg-picker {
    grid-area: bg;
    justify-self: end;
  }

  .chat-bg-picker-btn {
    max-width: 82px;
    padding: 7px 9px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-bg-picker-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto !important;
    bottom: calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px) + 10px) !important;
    width: auto;
    max-height: min(74svh, 560px) !important;
    border-radius: 18px;
    padding: 10px;
    z-index: 5000;
    transform: translateZ(0);
  }

  .chat-bg-picker-panel.chat-bg-picker-panel-portal {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px) + 10px) !important;
    width: auto !important;
    z-index: 9999 !important;
  }

  .chat-bg-picker-panel.open-upward {
    top: auto !important;
    bottom: calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px) + 10px) !important;
  }

  .chat-bg-picker-list {
    max-height: min(54svh, 430px);
    padding-right: 4px;
  }

  .chat-bg-opacity-control {
    position: sticky;
    bottom: 0;
    padding-top: 9px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.98));
  }

  .chat-message-list {
    padding: 12px 10px;
    gap: 10px;
  }

  .chat-bubble {
    max-width: min(82vw, 390px);
    border-radius: 18px;
    padding: 9px 11px;
    box-shadow: 0 8px 18px rgba(16, 48, 60, 0.09);
  }

  .chat-bubble-content {
    font-size: 15px;
    line-height: 1.55;
  }

  .chat-editor {
    padding: 8px 10px max(8px, calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px)));
    gap: 8px;
    background: rgba(252, 255, 254, 0.96);
    backdrop-filter: blur(8px);
  }

  #chatInput {
    min-height: 42px;
    height: 42px;
    max-height: 104px;
    border-radius: 15px;
    padding: 9px 11px;
    font-size: 16px;
  }

  #chatSendBtn {
    min-height: 42px;
    border-radius: 15px;
    padding: 0 15px;
    white-space: nowrap;
  }

  .mobile-tabs {
    left: 10px;
    right: 10px;
    bottom: max(8px, calc(env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px)));
    min-height: var(--mobile-tabbar-height);
    border-radius: 26px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    transition: transform 180ms ease, opacity 180ms ease;
    z-index: 1200;
    pointer-events: auto;
  }

  .zoo-page[data-active-tab="zoo"] .mobile-tabs {
    background: rgba(255, 255, 255, 0.2);
  }

  .zoo-page[data-active-tab="zoo"] .stage-hint {
    bottom: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px) + 16px);
  }

  #composerBackdrop {
    align-items: end;
    justify-items: center;
    padding-top: max(10px, calc(env(safe-area-inset-top) + 4px));
    padding-bottom: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom) + var(--mobile-browser-bottom-inset, 0px) + 14px);
  }

  #composerBackdrop .composer-card {
    max-height: calc(
      var(--app-viewport-height, 100svh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) -
        var(--mobile-tabbar-height) - var(--mobile-browser-bottom-inset, 0px) - 28px
    );
  }

  .zoo-page.mobile-chat-thread-open .mobile-tabs,
  .zoo-page.chat-input-focused .mobile-tabs,
  .zoo-page.composer-open .mobile-tabs {
    opacity: 0;
    transform: translateY(calc(100% + 16px));
    pointer-events: none;
  }
}

@media (max-width: 420px) {
  .zoo-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .zoo-actions {
    justify-self: end;
    width: auto;
  }

  .current-user {
    min-height: 40px;
    min-width: 42px;
  }

  .current-user-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .current-user-label {
    display: none;
  }

  .current-user-name {
    max-width: 48px;
    font-size: 14px;
  }

  #openComposerBtn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    aspect-ratio: 1 / 1;
  }

  #openComposerBtn::after {
    content: "";
    display: none;
  }

  #openComposerBtn::before {
    display: inline-block;
    margin-right: 0;
    transform: translateY(-1px);
  }

  .chat-thread-head {
    grid-template-columns: 30px auto minmax(0, 1fr) 36px auto;
    grid-template-areas: "back unread title profile bg";
    min-height: 50px;
    gap: 5px;
  }
}

@media (max-width: 860px) {
  .auth-body {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--auth-login-bg-url) right -20px top -132px / cover no-repeat;
  }

  .auth-layout {
    width: 100%;
    min-height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
    display: block;
    overflow: visible;
  }

  .auth-story {
    min-height: auto;
    border: 0;
    padding: max(28px, env(safe-area-inset-top)) 24px 20px;
    gap: 14px;
    background: transparent;
  }

  .auth-story::before {
    display: none;
  }

  .auth-story::after {
    display: none;
  }

  .story-badge,
  .auth-story h1,
  .story-divider,
  .story-prose {
    position: relative;
    z-index: 1;
  }

  .story-badge {
    padding: 10px 16px;
    font-size: 11px;
    letter-spacing: 0.11em;
    border-color: rgba(183, 214, 206, 0.78);
    color: #2f6b61;
    background: rgba(255, 255, 255, 0.5);
  }

  .auth-story h1 {
    font-size: clamp(36px, 10.2vw, 48px);
    line-height: 1.08;
    letter-spacing: 0.01em;
    margin-top: 0;
    color: #0a4a3e;
    text-align: left;
  }

  .story-divider {
    align-self: flex-start;
    width: clamp(178px, 50vw, 238px);
    height: 20px;
    font-size: 13px;
    color: #8eb7ac;
    margin-left: 0;
  }

  .story-prose {
    gap: 24px;
    max-width: 600px;
  }

  .story-prose p {
    font-size: clamp(12px, 3.3vw, 14px);
    line-height: 1.68;
    color: #1f3940;
    font-family: var(--font-serif);
    letter-spacing: 0.005em;
  }

  .auth-panel {
    padding: 8px 16px calc(env(safe-area-inset-bottom) + 18px);
    background: transparent;
    place-items: start center;
  }

  .auth-card {
    width: 100%;
    border: 1px solid rgba(206, 225, 219, 0.82);
    border-radius: 30px;
    padding: 20px 18px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 22px 40px rgba(10, 53, 62, 0.14);
  }

  .auth-title-wrap {
    gap: 0;
    margin-bottom: 0;
  }

  .auth-title-leaf {
    width: 34px;
    height: 34px;
    font-size: 22px;
    border-radius: 9px;
  }

  .auth-card h2 {
    font-size: clamp(22px, 6.2vw, 27px);
    line-height: 1.1;
    margin: 0;
  }

  .auth-kicker {
    margin: 2px 0 0;
    font-size: clamp(11px, 3.1vw, 13px);
  }

  .auth-mode-switch {
    display: none;
  }

  .auth-form {
    margin-top: 12px;
    gap: 8px;
  }

  .auth-input-row {
    min-height: 52px;
    border-radius: 16px;
    padding-left: 46px;
    padding-right: 44px;
    --auth-input-font-size: 17px;
    --auth-input-line-height: 1.25;
  }

  .auth-input-row input::placeholder {
    font-size: 12px;
    line-height: 1.25;
  }

  .auth-input-row .auth-input-icon {
    width: 20px;
    height: 20px;
    left: 16px;
  }

  .auth-input-eye {
    right: 10px;
    width: 26px;
    height: 26px;
    margin-top: -13px;
  }

  #displayNameGroup,
  #genderGroup,
  #emailGroup {
    margin-top: 2px;
  }

  .field-label {
    font-size: 11px;
    color: #4d6a72;
  }

  #displayNameGroup input,
  #emailGroup input {
    border-radius: 14px;
    padding: 10px 11px;
    font-size: 12px;
  }

  .gender-options {
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gender-option {
    min-height: 36px;
    border-radius: 13px;
    font-size: 11px;
  }

  .auth-card .submit-btn {
    margin-top: 4px;
    min-height: 46px;
    border-radius: 999px;
    font-family: var(--font-serif);
    font-size: 14px;
    letter-spacing: 0.02em;
    background: linear-gradient(120deg, #3d967f 0%, #379f88 52%, #49ab96 100%);
    box-shadow: 0 12px 22px rgba(53, 144, 124, 0.22);
  }

  .secondary-submit-btn {
    display: block;
    min-height: 46px;
    border-radius: 999px;
    margin-top: 4px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.82);
    border-color: #b8d8d0;
  }

  .auth-link-btn {
    margin-top: 8px;
    font-size: 11px;
    padding: 4px 0 0;
    letter-spacing: 0.02em;
    gap: 34px;
  }

  .auth-link-btn::before,
  .auth-link-btn::after {
    border-top-color: #d8e4e0;
  }

  .auth-msg {
    margin-top: 4px;
    font-size: 10px;
    min-height: 14px;
  }

  .auth-overlay {
    padding: 12px;
    z-index: 4000;
  }

  .auth-beian {
    bottom: calc(env(safe-area-inset-bottom) + 4px);
    gap: 6px;
    padding: 5px 10px;
    font-size: 10px;
    max-width: calc(100vw - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.hidden {
  display: none !important;
}
