:root {
  --bg: #f9f2d4;
  --card: #ffffff;
  --text: #333333;
  --muted: #6b6258;
  --primary: #e89313;
  --primary-strong: #F5C934;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --radius-xl: 16px;
  --radius-lg: 16px;
  --bottom-nav-block-height: 64px;
  --bottom-ad-banner-height: 0px;
  --bottom-fixed-offset: calc(var(--bottom-nav-block-height) + var(--bottom-ad-banner-height) + env(safe-area-inset-bottom, 0px));
}

/* Ensure all elements and their ::before/::after use border-box */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Prevent horizontal scroll and overflow for html/body */
html,
body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  /* Android Chrome: 關閉下拉觸發整頁重新整理（pull-to-refresh） */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  padding-top: env(safe-area-inset-top);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, #f9f2d4 0%, #f9f2d4 34%, #f9f2d4 100%);
  color: var(--text);
}

/* App 內啟動過場（與 manifest 桌面圖示分開） */
.app-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 50000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: #f9f2d4;
  box-sizing: border-box;
  transition: opacity 0.38s ease;
}

.app-splash-screen.hidden {
  display: none;
}

.app-splash-screen--hiding {
  opacity: 0;
  pointer-events: none;
}

.app-splash-screen__img {
  display: block;
  width: min(72vw, 280px);
  height: auto;
  max-height: min(72vh, 320px);
  object-fit: contain;
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.08);
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
}

.main {
  width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
}

.content {
  padding: 18px 16px calc(var(--bottom-fixed-offset) + 76px);
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

/* 全域可點擊回饋：按下 scale + opacity（方案 A，僅 transform / opacity / outline） */
button,
[type="button"],
[type="submit"],
[type="reset"],
[role="button"] {
  transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: rgba(8, 145, 178, 0.18);
  touch-action: manipulation;
}

button:not(:disabled):active,
button:not(:disabled).is-tap-pressed,
[type="button"]:not(:disabled):active,
[type="button"]:not(:disabled).is-tap-pressed,
[type="submit"]:not(:disabled):active,
[type="submit"]:not(:disabled).is-tap-pressed,
[type="reset"]:not(:disabled):active,
[type="reset"]:not(:disabled).is-tap-pressed,
[role="button"]:not([aria-disabled="true"]):active,
[role="button"]:not([aria-disabled="true"]).is-tap-pressed {
  transform: scale(0.94);
  opacity: 0.82;
}

button:focus-visible,
[type="button"]:focus-visible,
[type="submit"]:focus-visible,
[type="reset"]:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid rgba(8, 145, 178, 0.45);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  button,
  [type="button"],
  [type="submit"],
  [type="reset"],
  [role="button"] {
    transition: none;
  }

  button:not(:disabled):active,
  button:not(:disabled).is-tap-pressed,
  [type="button"]:not(:disabled):active,
  [type="button"]:not(:disabled).is-tap-pressed,
  [type="submit"]:not(:disabled):active,
  [type="submit"]:not(:disabled).is-tap-pressed,
  [type="reset"]:not(:disabled):active,
  [type="reset"]:not(:disabled).is-tap-pressed,
  [role="button"]:not([aria-disabled="true"]):active,
  [role="button"]:not([aria-disabled="true"]).is-tap-pressed {
    transform: none;
    opacity: 1;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.card--login {
  max-width: 420px;
  width: 100%;
  padding: 22px 18px;
  box-sizing: border-box;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  box-sizing: border-box;
}

.login-actions__google {
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
  overflow: visible;
}

.google-signin-button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  overflow: visible;
  text-align: center;
  line-height: 0;
}

.google-signin-button > div {
  display: inline-block;
  vertical-align: top;
  max-width: 100%;
}

.google-signin-button iframe {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.login-google-external-fallback {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

.login-google-external-fallback__btn-google {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  margin: 0;
  border: 1px solid #dadce0;
  border-radius: 9999px;
  background: #fff;
  color: #3c4043;
  font-size: 14px;
  font-weight: 500;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.login-google-external-fallback__btn-google:hover {
  background: #f8f9fa;
  border-color: #d2d2d2;
}

.login-google-external-fallback__btn-google:active {
  background: #f1f3f4;
}

.login-google-external-fallback__g-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.login-google-external-fallback__g-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-actions #line-login-button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

.title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-sizing: border-box;
}

.subtitle {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  box-sizing: border-box;
}

.settings-add-to-home-card {
  border-radius: 16px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  background: #fff;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

/* ── 設定與工具：方案 A 分組版面 ── */
.settings-profile-card {
  border-radius: 1.75rem;
  border: 1px solid rgba(6, 182, 212, 0.18);
  background: linear-gradient(135deg, #FFFEF0 0%, #f0fdfa 100%);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.08);
}

.settings-profile-card__main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-profile-card__avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.settings-profile-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-profile-card__info {
  min-width: 0;
  flex: 1;
}

.settings-profile-card__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #0e7490;
  line-height: 1.35;
  word-break: break-word;
}

.settings-profile-card__provider {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 650;
  color: rgba(51, 65, 85, 0.72);
}

.settings-profile-card__family {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(6, 182, 212, 0.12);
}

.settings-profile-card__family-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.9);
}

.settings-profile-card__family-select {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(6, 182, 212, 0.22);
  background: rgba(255, 254, 240, 0.92);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #0e7490;
  outline: none;
}

.settings-profile-card__family-select:focus {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

.settings-section-title {
  margin: 0 0 10px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.88);
}

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

.settings-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 108px;
  padding: 14px 8px;
  border-radius: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #FFFEF0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.settings-tool-card:active {
  transform: scale(0.97);
}

.settings-tool-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 1rem;
}

.settings-tool-card__icon--amber {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.settings-tool-card__icon--violet {
  background: rgba(139, 92, 246, 0.14);
  color: #7c3aed;
}

.settings-tool-card__icon--emerald {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.settings-tool-card__label {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  color: #0f172a;
}

.settings-tool-card--amber:hover {
  background: rgba(255, 251, 235, 0.95);
}

.settings-tool-card--violet:hover {
  background: rgba(245, 243, 255, 0.95);
}

.settings-tool-card--emerald:hover {
  background: rgba(236, 253, 245, 0.95);
}

.settings-list-group {
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid rgba(6, 182, 212, 0.14);
  background: #FFFEF0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.settings-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.settings-list-row:last-child {
  border-bottom: none;
}

.settings-list-row:hover {
  background: rgba(236, 254, 255, 0.65);
}

.settings-list-row:active {
  background: rgba(207, 250, 254, 0.85);
}

.settings-list-row__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.85rem;
}

.settings-list-row__icon--cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
}

.settings-list-row__icon--blue {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.settings-list-row__icon--indigo {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.settings-list-row__icon--orange {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.settings-list-row__icon--teal {
  background: rgba(20, 184, 166, 0.12);
  color: #0d9488;
}

.settings-list-row__icon--slate {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.settings-list-row__label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.settings-list-row__chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: rgba(100, 116, 139, 0.65);
}

.settings-add-to-home-platform {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  color: #0f766e;
  line-height: 1.4;
}

.settings-add-to-home-lead {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: #475569;
}

.settings-add-to-home-steps {
  margin: 0 0 14px;
  padding-left: 20px;
  list-style: decimal;
}

.settings-add-to-home-steps li {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  color: #0f172a;
  margin-bottom: 8px;
}

.settings-add-to-home-steps li:last-child {
  margin-bottom: 0;
}

.settings-add-to-home-open-browser {
  margin-top: 4px;
}

.settings-add-to-home-panel {
  margin-bottom: 12px;
}

.settings-add-to-home-standalone-message {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: #475569;
}

.settings-add-to-home-install-button {
  margin-bottom: 12px;
}

.settings-add-to-home-fallback-hint {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  color: #64748b;
}

.settings-add-to-home-ios-guide {
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-add-to-home-guide-step {
  margin-bottom: 16px;
}

.settings-add-to-home-guide-step:last-child {
  margin-bottom: 0;
}

.settings-add-to-home-guide-step__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  color: #0f766e;
}

.settings-add-to-home-guide-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 12px;
  font-weight: 900;
}

.settings-add-to-home-guide-step__text {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: #475569;
}

.settings-add-to-home-guide-step__media {
  min-height: 120px;
  border-radius: 12px;
  border: 1px dashed rgba(6, 182, 212, 0.35);
  background: rgba(236, 254, 255, 0.35);
  overflow: hidden;
}

.settings-add-to-home-guide-step__media:empty {
  display: block;
}

.settings-add-to-home-guide-step__img {
  display: block;
  width: 100%;
  height: auto;
}

.btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.btn:active:not(:disabled) {
  transform: scale(0.94);
  opacity: 0.82;
}

.btn--primary {
  background: var(--primary);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--primary-strong);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  width: auto;
}

.alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.45;
  box-sizing: border-box;
}

.alert--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: rgb(185, 28, 28);
}

.alert--warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: rgb(154, 52, 18);
}

.login-invite-notice {
  margin-top: 12px;
  margin-bottom: 14px;
  padding: 0;
  box-sizing: border-box;
}

.login-invite-notice__text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: rgb(14, 116, 144);
  text-align: center;
}

.line-inapp-login-notice__message {
  margin: 0 0 10px;
}

.line-inapp-login-notice__button {
  width: 100%;
}

.pet-card-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  min-height: auto;
  margin-top: 10px;
  box-sizing: border-box;
}

.pet-page .pet-card-wrap {
  display: none;
}

.pet-card {
  width: 100%;
  max-width: 480px;
  padding: 18px;
  position: relative;
  box-sizing: border-box;
}

.pet-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 15px;
  box-sizing: border-box;
}

.pet-card__badge {
  font-size: 14px;
  font-weight: 800;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.22);
  color: rgb(8, 145, 178);
  padding: 6px 10px;
  border-radius: 999px;
  box-sizing: border-box;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(2, 132, 199, 0.18);
  background: rgba(6, 182, 212, 0.08);
  color: rgb(8, 145, 178);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
}

.icon-btn--sm {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 16px;
  box-sizing: border-box;
}

.pet-row--concealed {
  display: none;
}

.pets-fab-menu {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 16px;
  z-index: 31;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.pets-fab-menu__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 9.5rem;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.pets-fab-menu--open .pets-fab-menu__actions {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.pets-fab-menu__chip {
  border: 1px solid rgba(196, 180, 154, 0.55);
  background: #fffef9;
  color: #5c4a3a;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(92, 74, 58, 0.12);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pets-fab-menu__chip:hover {
  border-color: rgba(232, 147, 19, 0.45);
  background: rgba(245, 201, 52, 0.22);
}

.pets-fab-menu__chip:active {
  transform: scale(0.98);
}

.add-pet-floating {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(51, 51, 51, 0.28);
  background: rgba(245, 201, 52, 0.14);
  color: #333333;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(51, 51, 51, 0.16);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.add-pet-floating:active {
  transform: translateY(1px);
}

.add-pet-floating--tips {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(16px + 44px + 10px);
  z-index: 31;
}

.add-pet-floating__svg {
  width: 22px;
  height: 22px;
  display: block;
  box-sizing: border-box;
}

.add-pet-floating__gif {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  box-sizing: border-box;
}

/* 我的毛孩：右下角「毛孩衛教」入口（僅圖示 + 箭頭；可調 bottom 以配合底部導覽高度） */
.pet-health-edu-entry {
  position: fixed;
  z-index: 25;
  right: 12px;
  bottom: calc(var(--bottom-fixed-offset) + 12px);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 64px;
  height: 48px;
  padding: 0 12px;
  margin: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  background: #faf6f0;
  box-shadow: 0 8px 22px rgba(61, 52, 44, 0.12);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.pet-health-edu-entry:active {
  transform: translateY(1px);
}

.pet-health-edu-entry:focus-visible {
  outline: 2px solid rgb(8, 145, 178);
  outline-offset: 2px;
}

.pet-health-edu-entry__icon-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: #333333;
  box-sizing: border-box;
}

.pet-health-edu-entry__svg {
  width: 24px;
  height: 24px;
  display: block;
  box-sizing: border-box;
}

.pet-health-edu-entry__chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a8a29e;
}

.pet-health-edu-entry__chevron svg {
  display: block;
  box-sizing: border-box;
}

/* 毛孩衛教：全畫面文章列表（左圖示區／標題／右箭頭） */
.pet-sub-screen--health-edu {
  background: #FFF9F6;
}

.pet-sub-screen--health-edu .pet-sub-screen__header {
  background: rgba(255, 252, 248, 0.96);
  border-bottom-color: rgba(120, 90, 60, 0.12);
}

.pet-sub-screen__header--health-edu::after {
  display: none;
}

.pet-health-edu-search-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(180, 150, 120, 0.35);
  border-radius: 16px;
  background: #fffdf8;
  color: #6b4423;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.pet-health-edu-search-btn:active {
  transform: scale(0.96);
  background: #f5f0e6;
}

.pet-health-edu-search-btn:focus-visible {
  outline: 2px solid rgba(232, 147, 19, 0.55);
  outline-offset: 2px;
}

.pet-health-edu-search-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #FFF9F6;
  box-sizing: border-box;
}

.pet-health-edu-search-panel__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 0;
  box-sizing: border-box;
}

.pet-health-edu-search-panel__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid rgba(180, 150, 120, 0.28);
  color: #a8a29e;
  box-sizing: border-box;
}

.pet-health-edu-search-panel__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(180, 150, 120, 0.35);
  border-radius: 14px;
  background: #fff;
  color: #44403c;
  font-size: 15px;
  font-weight: 600;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.pet-health-edu-search-panel__input::placeholder {
  color: #a8a29e;
  font-weight: 500;
}

.pet-health-edu-search-panel__input:focus {
  outline: none;
  border-color: rgba(232, 147, 19, 0.55);
  box-shadow: 0 0 0 2px rgba(232, 147, 19, 0.15);
}

.pet-health-edu-search-panel__cancel {
  flex-shrink: 0;
  margin: 0;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: #b45309;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pet-health-edu-search-panel__cancel:active {
  opacity: 0.75;
}

.pet-health-edu-search-tags {
  flex-shrink: 0;
  box-sizing: border-box;
}

.pet-health-edu-search-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.pet-health-edu-search-results__empty {
  margin: 0;
  padding: 20px 20px 28px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: #a8a29e;
  box-sizing: border-box;
}

.pet-sub-screen--health-edu .pet-sub-screen__title {
  color: #4a3d32;
}

.pet-health-edu-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #FFF9F6;
  box-sizing: border-box;
}

.pet-health-edu-row {
  box-sizing: border-box;
}

.pet-health-edu-row__thumb-icon {
  display: block;
  color: #b45309;
  box-sizing: border-box;
}

.pet-health-edu-row__title {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #44403c;
  min-width: 0;
  box-sizing: border-box;
}

.pet-health-edu-row__arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 14px 0 0;
  color: #a8a29e;
  box-sizing: border-box;
}

.pet-health-edu-row__arrow svg {
  display: block;
  box-sizing: border-box;
}

.pet-health-edu-list-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 14px 20px;
  box-sizing: border-box;
}

.pet-health-edu-home,
.pet-health-edu-section-page {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 20px;
  box-sizing: border-box;
}

.pet-health-edu-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px 0;
  box-sizing: border-box;
}

.pet-health-edu-section-card {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(180, 150, 120, 0.28);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(74, 61, 50, 0.06);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pet-health-edu-section-card:active {
  transform: scale(0.98);
}

.pet-health-edu-section-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44%;
  height: 44%;
  opacity: 0.88;
}

.pet-health-edu-section-card__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pet-health-edu-section-card__label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: right;
  max-width: calc(100% - 16px);
  word-break: break-word;
}

.pet-health-edu-home-divider {
  margin: 14px 14px 0;
  border: none;
  border-top: 1px solid rgba(180, 150, 120, 0.35);
}

.pet-health-edu-home .pet-health-edu-list-cards {
  padding-top: 12px;
}

.pet-health-edu-section-back {
  display: inline-flex;
  align-items: center;
  margin: 12px 14px 0;
  padding: 6px 12px;
  border: 1px solid rgba(180, 150, 120, 0.35);
  border-radius: 12px;
  background: #faf6ee;
  color: #6b4423;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pet-health-edu-section-back:active {
  background: #f0e8dc;
}

.pet-health-edu-section-page__title {
  margin: 10px 14px 0;
  font-size: 15px;
  font-weight: 900;
  color: #4a3d32;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

.pet-health-edu-tag-wrap {
  padding: 0;
  box-sizing: border-box;
}

.pet-health-edu-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
  padding: 12px 14px 4px;
  box-sizing: border-box;
  transition: max-height 0.2s ease;
}

.pet-health-edu-tag-bar--collapsed {
  max-height: 72px;
}

.pet-health-edu-tag-bar--expanded {
  max-height: none;
}

.pet-health-edu-tag-toggle {
  display: block;
  width: calc(100% - 28px);
  margin: 6px 14px 0;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: #8b5a2b;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pet-health-edu-tag-toggle.hidden {
  display: none;
}

.pet-health-edu-tag-toggle:active {
  color: #6b4423;
}

.pet-health-edu-tag-chip {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid rgba(180, 150, 120, 0.35);
  border-radius: 999px;
  background: #fffdf8;
  color: #6b4423;
  font-size: 12px;
  font-weight: 750;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.pet-health-edu-tag-chip--active {
  background: rgba(232, 147, 19, 0.18);
  border-color: rgba(232, 147, 19, 0.45);
  color: #4a3d32;
  font-weight: 800;
}

.pet-health-edu-section-page .pet-health-edu-list-cards {
  padding-top: 8px;
}

.pet-health-edu-list .pet-health-edu-list-card,
.pet-health-edu-search-results .pet-health-edu-list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin: 0;
  border: 1px solid rgba(180, 150, 120, 0.28);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 2px 8px rgba(74, 61, 50, 0.06);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.pet-health-edu-list .pet-health-edu-list-card:active,
.pet-health-edu-search-results .pet-health-edu-list-card:active {
  transform: scale(0.99);
  background: #f5f0e6;
}

.pet-health-edu-list .pet-health-edu-row__thumb,
.pet-health-edu-search-results .pet-health-edu-row__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  border-right: none;
  border: none;
  border-radius: 12px;
  background: #e8dfd2;
  overflow: hidden;
}

.pet-health-edu-list .pet-health-edu-row__thumb img,
.pet-health-edu-search-results .pet-health-edu-row__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-health-edu-list .pet-health-edu-row__title,
.pet-health-edu-search-results .pet-health-edu-row__title {
  display: block;
  flex: none;
  align-items: unset;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #4a3d32;
  line-height: 1.45;
}

.pet-health-edu-row__category {
  font-size: 11px;
  font-weight: 750;
  color: #6b4423;
  letter-spacing: 0.02em;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.pet-health-edu-list .pet-health-edu-row__arrow,
.pet-health-edu-search-results .pet-health-edu-row__arrow {
  padding: 0;
  color: #a89580;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.pet-health-edu-status {
  max-width: 520px;
  width: calc(100% - 28px);
  margin: 24px auto 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 150, 120, 0.28);
  background: #fffdf8;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  color: #5c4a3a;
  line-height: 1.55;
  box-sizing: border-box;
}

.pet-health-edu-status--error {
  color: #9b3b2f;
  border-color: rgba(155, 59, 47, 0.22);
  background: #fef7f5;
}

.pet-health-edu-article-detail {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 14px 20px;
  box-sizing: border-box;
}

.pet-health-edu-article-detail__card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(180, 150, 120, 0.28);
  background: #fffdf8;
  box-shadow: 0 2px 8px rgba(74, 61, 50, 0.06);
  box-sizing: border-box;
}

.pet-health-edu-article-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 12px;
  padding: 6px 12px;
  border: 1px solid rgba(180, 150, 120, 0.35);
  border-radius: 12px;
  background: #faf6ee;
  color: #6b4423;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.pet-health-edu-article-detail__back:active {
  background: #f0e8dc;
}

.pet-health-edu-article-detail__title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: #6b4423;
  letter-spacing: 0.04em;
  line-height: 1.45;
  word-break: break-word;
}

.pet-health-edu-detail-hero {
  width: 100%;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(180, 150, 120, 0.28);
  background: #e8dfd2;
}

.pet-health-edu-detail-hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.pet-health-edu-article-body {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 150, 120, 0.28);
  background: #faf6ee;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
  word-break: break-word;
  box-sizing: border-box;
}

.pet-health-edu-article-body p {
  margin: 0.55rem 0;
  color: var(--muted);
}

.pet-health-edu-article-body p:first-child {
  margin-top: 0;
}

.pet-health-edu-article-body p:last-child {
  margin-bottom: 0;
}

.pet-health-edu-article-body strong {
  font-weight: 800;
  color: #4a3d32;
}

.pet-health-edu-article-body em {
  font-style: italic;
  color: #6b6258;
}

.pet-health-edu-article-body a {
  color: #8b5a2b;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pet-health-edu-article-body a:active {
  color: var(--primary);
}

.pet-health-edu-article-body .notion-h1,
.pet-health-edu-article-body h1 {
  margin: 1.1rem 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.45;
  color: #3d3228;
  letter-spacing: 0.03em;
}

.pet-health-edu-article-body .notion-h2,
.pet-health-edu-article-body h2 {
  margin: 1rem 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.5;
  color: #4a3d32;
  letter-spacing: 0.02em;
}

.pet-health-edu-article-body .notion-h3,
.pet-health-edu-article-body h3 {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.5;
  color: #5c4a3a;
}

.pet-health-edu-article-body .notion-divider,
.pet-health-edu-article-body hr {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid rgba(180, 150, 120, 0.35);
}

.pet-health-edu-article-body .notion-quote,
.pet-health-edu-article-body blockquote {
  margin: 0.75rem 0;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: rgba(232, 147, 19, 0.08);
  color: var(--muted);
}

.pet-health-edu-article-body .notion-list {
  margin: 0.45rem 0 0.75rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.pet-health-edu-article-body .notion-list li {
  margin: 0.3rem 0;
  color: var(--muted);
}

.pet-health-edu-article-body .notion-callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0.75rem 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 150, 120, 0.28);
  background: #fffdf8;
}

.pet-health-edu-article-body .notion-callout__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}

.pet-health-edu-article-body .notion-callout__body {
  flex: 1;
  min-width: 0;
}

.pet-health-edu-article-body .notion-callout__body p {
  margin: 0;
  color: var(--muted);
}

.pet-health-edu-article-body .notion-callout--blue_background,
.pet-health-edu-article-body .notion-callout--blue {
  background: rgba(232, 147, 19, 0.06);
  border-color: rgba(232, 147, 19, 0.22);
}

.pet-health-edu-article-body .notion-callout--gray_background,
.pet-health-edu-article-body .notion-callout--gray {
  background: #f5f0e6;
  border-color: rgba(180, 150, 120, 0.28);
}

.pet-health-edu-article-body .notion-callout--yellow_background,
.pet-health-edu-article-body .notion-callout--yellow {
  background: rgba(245, 201, 52, 0.14);
  border-color: rgba(232, 147, 19, 0.28);
}

.pet-health-edu-article-body .notion-callout--green_background,
.pet-health-edu-article-body .notion-callout--green {
  background: #f3faf4;
  border-color: rgba(120, 160, 120, 0.28);
}

.pet-health-edu-article-body .notion-callout--red_background,
.pet-health-edu-article-body .notion-callout--red {
  background: #fef7f5;
  border-color: rgba(155, 59, 47, 0.22);
}

.pet-health-edu-article-body .notion-image img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 12px;
}

.pet-health-edu-article-body .notion-image {
  margin: 0.75rem 0;
}

.pet-health-edu-article-body .notion-code {
  margin: 0.75rem 0;
  padding: 12px;
  overflow-x: auto;
  border-radius: 12px;
  background: #fffdf8;
  border: 1px solid rgba(180, 150, 120, 0.22);
  font-size: 12px;
  color: #5c4a3a;
}

.pet-health-edu-article-body .notion-toggle {
  margin: 0.65rem 0;
  padding: 10px 12px;
  border: 1px solid rgba(180, 150, 120, 0.28);
  border-radius: 12px;
  background: #fffdf8;
}

.pet-health-edu-article-body .notion-toggle summary {
  cursor: pointer;
  font-weight: 800;
  color: #4a3d32;
}

.pet-health-edu-article-body .notion-toggle__body {
  margin-top: 0.5rem;
  color: var(--muted);
}

.pet-health-edu-article-body .notion-equation {
  color: var(--muted);
}

.pet-health-edu-article-body--empty {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 650;
  color: rgba(92, 74, 58, 0.65);
  text-align: center;
}

.pet-intro-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 14px 0 18px;
  box-sizing: border-box;
}

.pet-intro-text {
  width: 60%;
  max-width: min(320px, 90vw);
  min-height: 3.25em;
  margin: 0;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(2, 132, 199, 0.12);
  background: transparent;
  color: rgb(51, 65, 85);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  text-align: center;
  box-shadow: none;
  box-sizing: border-box;
  word-break: break-word;
}

.pet-sub-screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  margin: 0;
  background-color: #f9f2d4;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}

.pet-sub-screen:not(.hidden) {
  display: flex !important;
  position: fixed !important;
}

.pet-sub-screen__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #f9f2d4;
  pointer-events: none;
}

.pet-sub-screen > .pet-sub-screen__header,
.pet-sub-screen > .pet-detail-content-stack,
.pet-sub-screen > .pet-sub-screen__body,
.pet-sub-screen > .pet-health-edu-search-panel,
.pet-sub-screen > .pet-health-edu-list {
  position: relative;
  z-index: 1;
}

/* 毛孩詳細／通知／衛教開啟時：完全隱藏底層「我的毛孩」與浮動按鈕 */
body.pet-sub-screen-open #pets-content,
body.pet-sub-screen-open #pet-tips-entry-button,
body.pet-sub-screen-open #pets-fab-menu,
body.pet-sub-screen-open #add-pet-button,
body.pet-sub-screen-open #pet-health-education-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.pet-sub-screen-open #bottom-chrome {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.pet-sub-screen-open .pets-page-tutorial-layer {
  display: none !important;
}

#pet-detail-screen .pet-sub-screen__header {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#pet-detail-screen .pet-sub-screen__header::after {
  display: none;
}

.pet-detail-health-edu-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(245, 201, 52, 0.26);
  border-radius: 16px;
  background: rgba(245, 201, 52, 0.14);
  color: #333333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button.pet-detail-health-edu-btn:not(:disabled):active,
button.pet-detail-health-edu-btn:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
  background: rgba(245, 201, 52, 0.36);
  border-color: rgba(245, 201, 52, 0.5);
}

.pet-detail-health-edu-btn:focus-visible {
  outline: 2px solid rgb(8, 145, 178);
  outline-offset: 2px;
}

.pet-detail-health-edu-btn .pet-health-edu-entry__icon-wrap {
  padding: 0;
}

#pet-detail-screen {
  background-color: var(--bg);
}

/* 三列版面：標題列 / 可捲動主板文 / 按鈕列（避免捲動層蓋住按鈕） */
#pet-detail-screen.pet-sub-screen:not(.hidden) {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: 1fr;
  overflow: hidden;
}

#pet-detail-screen > .pet-sub-screen__backdrop {
  grid-row: 1 / -1;
  grid-column: 1;
  position: relative;
  z-index: 0;
}

#pet-detail-screen > .pet-sub-screen__header {
  grid-row: 1;
  grid-column: 1;
  z-index: 2;
  grid-template-columns: 1fr auto 1fr;
}

#pet-detail-screen > .pet-sub-screen__header .pet-detail-header-leading {
  justify-self: start;
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pet-detail-restore-reminders-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(6, 182, 212, 0.32);
  border-radius: 16px;
  background: rgba(6, 182, 212, 0.1);
  color: #0f766e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button.pet-detail-restore-reminders-btn:not(:disabled):active,
button.pet-detail-restore-reminders-btn:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
  background: rgba(6, 182, 212, 0.24);
  border-color: rgba(6, 182, 212, 0.48);
}

.pet-detail-restore-reminders-btn:focus-visible {
  outline: 2px solid rgba(8, 145, 178, 0.45);
  outline-offset: 2px;
}

.pet-detail-restore-reminders-btn__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.pet-detail-restore-reminders-btn__icon-wrap svg {
  width: 20px;
  height: 20px;
  display: block;
}

#pet-detail-screen > .pet-sub-screen__header .pet-sub-screen__title {
  justify-self: center;
  grid-column: 2;
  max-width: min(72vw, 11rem);
}

#pet-detail-screen > .pet-sub-screen__header .pet-detail-header-actions {
  justify-self: end;
  grid-column: 3;
}

.pet-detail-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  min-width: 0;
}

.pet-detail-appointment-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(6, 182, 212, 0.32);
  border-radius: 16px;
  background: rgba(6, 182, 212, 0.1);
  color: #0f766e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button.pet-detail-appointment-btn:not(:disabled):active,
button.pet-detail-appointment-btn:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
  background: rgba(6, 182, 212, 0.24);
  border-color: rgba(6, 182, 212, 0.48);
}

.pet-detail-appointment-btn:focus-visible {
  outline: 2px solid rgb(8, 145, 178);
  outline-offset: 2px;
}

.pet-detail-appointment-btn__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pet-detail-appointment-btn__icon-wrap svg {
  display: block;
}

#pet-appointment-modal.modal {
  z-index: 400;
}

#pet-appointment-modal .modal__overlay {
  cursor: pointer;
}

#pet-weight-update-modal.modal {
  z-index: 400;
}

#pet-weight-update-modal .modal__overlay {
  cursor: pointer;
}

#pet-status-picker-modal.modal,
#pet-status-actions-modal.modal {
  z-index: 400;
}

#pet-status-picker-modal .modal__overlay,
#pet-status-actions-modal .modal__overlay {
  cursor: pointer;
}

.pet-status-picker-modal__panel,
.pet-status-actions-modal__panel {
  max-width: 420px;
}

.pet-status-picker-modal__body,
.pet-status-actions-modal__body {
  background: #fffef9;
}

.pet-status-picker-modal__hint {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #8b7355;
}

.pet-status-picker-grid__wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.pet-status-picker-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 5.75rem;
  padding: 12px 8px;
  gap: 8px;
  border-radius: 1.25rem;
  border: 1px solid rgba(196, 180, 154, 0.4);
  background: #fffef9;
  box-shadow: 0 4px 12px rgba(92, 74, 58, 0.08);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.pet-status-picker-tile:active,
.pet-status-picker-tile--tap-feedback {
  transform: scale(0.96);
}

.pet-status-picker-tile__avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
}

.pet-status-picker-tile__name {
  width: 100%;
  font-size: 13px;
  font-weight: 800;
  color: #5c4a3a;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-status-picker-modal__empty {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #8b7355;
  text-align: center;
}

.pet-status-actions-modal__pet-name {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 900;
  color: #5c4a3a;
  text-align: center;
}

.pet-status-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.pet-status-field-head .field__label {
  margin: 0;
}

.pet-status-no-scale-btn {
  flex-shrink: 0;
  max-width: 52%;
  margin: 0;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: #8b7355;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.pet-status-weight-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pet-status-weight-input-wrap .input {
  flex: 1;
  min-width: 0;
}

.pet-status-weight-estimate-tag {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: #8b7355;
  white-space: nowrap;
}

#pet-bcs-modal.modal {
  z-index: 410;
}

#pet-bcs-modal .modal__overlay {
  cursor: pointer;
}

.pet-bcs-modal__panel {
  max-width: 420px;
}

.pet-bcs-modal__body {
  background: #fffef9;
}

.pet-bcs-step-heading {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
  color: #5c4a3a;
}

.pet-bcs-step-prompt {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: #5c4a3a;
}

.pet-bcs-score-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 10px;
}

.pet-bcs-score-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 4px 0;
  border-radius: 10px;
  border: 1px solid rgba(196, 180, 154, 0.55);
  background: #fff;
  color: #5c4a3a;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pet-bcs-score-btn--active {
  border-color: rgba(232, 147, 19, 0.65);
  background: rgba(245, 201, 52, 0.35);
  color: #5c4a3a;
}

.pet-bcs-score-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pet-bcs-score-legend__item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pet-bcs-score-legend__item--high {
  text-align: right;
  align-items: flex-end;
}

.pet-bcs-score-legend__score {
  font-size: 12px;
  font-weight: 900;
  color: #8b7355;
}

.pet-bcs-score-legend__text {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  color: #8b7355;
}

.pet-bcs-modal__actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.pet-bcs-back {
  flex: 0 0 auto;
  width: auto;
  min-width: 5.5rem;
}

.pet-bcs-next {
  flex: 1;
  min-width: 0;
}

.pet-bcs-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pet-status-photo-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pet-status-photo-pick-btn {
  width: 100%;
  margin-top: 4px;
}

.pet-status-photo-file-name {
  margin-top: 6px;
}

.pet-status-neuter-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.pet-status-neuter-toggle__btn {
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(196, 180, 154, 0.5);
  background: #fff;
  color: #5c4a3a;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pet-status-neuter-toggle__btn--active {
  border-color: rgba(232, 147, 19, 0.55);
  background: rgba(245, 201, 52, 0.28);
  color: #5c4a3a;
}

.pet-status-neuter-toggle__btn--locked,
.pet-status-neuter-toggle__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.pet-status-form__submit {
  margin-top: 8px;
}

.pet-status-actions-modal__locked-hint {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: #8b7355;
  text-align: center;
}

#pet-appointment-modal .modal__panel.pet-appointment-modal__panel {
  max-width: 420px;
}

.pet-appointment-modal__body {
  padding-top: 4px;
}

.pet-appointment-modal__hint {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: #64748b;
}

.pet-appointment-modal__hint--detail {
  margin: -4px 0 12px;
  padding: 0 2px;
}

.pet-appointment-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.pet-appointment-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 0;
  padding: 10px 6px 8px;
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.pet-appointment-type-btn:hover {
  background: rgba(6, 182, 212, 0.06);
  border-color: rgba(6, 182, 212, 0.35);
}

.pet-appointment-type-btn:active {
  transform: scale(0.98);
}

.pet-appointment-type-btn:focus-visible {
  outline: 2px solid rgb(8, 145, 178);
  outline-offset: 2px;
}

.pet-appointment-type-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #0891b2;
}

.pet-appointment-type-btn__icon svg,
.pet-appointment-type-btn__icon .pet-appointment-type-btn__svg {
  display: block;
  width: 22px;
  height: 22px;
}

.pet-appointment-type-btn__label {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  color: #334155;
  width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.pet-appointment-step-detail.hidden {
  display: none !important;
}

.pet-appointment-modal__date-line {
  margin: 14px 0 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  color: #0f766e;
}

.pet-appointment-save-diary-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-weight: 900;
  box-sizing: border-box;
}

.pet-appointment-detail-card {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  padding: 14px 14px 12px;
  box-sizing: border-box;
}

.pet-appointment-detail-card__title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.pet-appointment-detail-card__dl {
  margin: 0;
}

.pet-appointment-detail-card__row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  align-items: start;
}

.pet-appointment-detail-card__row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pet-appointment-detail-card__row dt {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.pet-appointment-detail-card__row dd {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.pet-appointment-detail-card__dd-editable {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pet-appointment-detail-card__value {
  flex: 1;
  min-width: 0;
}

.pet-appointment-edit-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(8, 145, 178, 0.28);
  border-radius: 12px;
  background: rgba(8, 145, 178, 0.08);
  color: #0891b2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.pet-appointment-edit-btn:active {
  transform: translateY(1px);
}

.pet-appointment-edit-btn:focus-visible {
  outline: 2px solid rgb(8, 145, 178);
  outline-offset: 2px;
}

.pet-appointment-field-input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  border: 1px solid rgba(8, 145, 178, 0.35);
  border-radius: 10px;
  padding: 6px 8px;
  box-sizing: border-box;
  background: #fff;
}

.pet-appointment-field-input[hidden] {
  display: none !important;
}

@media (max-width: 360px) {
  .pet-appointment-type-grid {
    gap: 8px;
  }

  .pet-appointment-type-btn {
    padding: 8px 4px 6px;
  }

  .pet-appointment-type-btn__label {
    font-size: 10px;
  }
}

#pet-detail-screen > .pet-detail-content-stack {
  grid-row: 2;
  grid-column: 1;
  z-index: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  background-color: var(--bg);
}

#pet-detail-screen > .pet-detail-icons-dock {
  grid-row: 3;
  grid-column: 1;
  z-index: 2;
  position: relative;
  background-color: var(--bg);
}

#pet-detail-screen .pet-detail-main-panel {
  background-color: var(--bg);
}

.pet-sub-screen.hidden {
  display: none !important;
}

.pet-sub-screen__header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  min-width: 0;
  flex-shrink: 0;
}

.pet-sub-screen__header::after {
  content: "";
  width: 44px;
  height: 44px;
}

.pet-sub-screen__back {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(245, 201, 52, 0.26);
  background: rgba(245, 201, 52, 0.14);
  color: #F5C934;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button.pet-sub-screen__back:not(:disabled):active,
button.pet-sub-screen__back:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
  background: rgba(245, 201, 52, 0.36);
  border-color: rgba(245, 201, 52, 0.5);
  color: #e5b800;
}

.pet-sub-screen__title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: rgb(15, 23, 42);
  letter-spacing: 0.02em;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pet-sub-screen__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
}

.settings-legal-prose {
  font-size: 13px;
  line-height: 1.65;
  color: rgb(51, 65, 85);
  box-sizing: border-box;
}

.settings-legal-prose__meta {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: rgb(100, 116, 139);
}

.settings-legal-prose__h {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: rgb(15, 23, 42);
}

.settings-legal-prose p {
  margin: 0 0 10px;
}

.settings-legal-prose__list {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  list-style: disc;
}

.settings-legal-prose__list li {
  margin-bottom: 6px;
}

.settings-legal-prose__link {
  color: rgb(8, 145, 178);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* SUISA 品牌文字色（About 頁標題與內文） */
.pet-sub-screen__title--suisa-brand {
  color: #6b7a52;
}

.settings-about-suisa-hero {
  display: flex;
  justify-content: center;
  margin: 0 0 1.25rem;
  padding-top: 0.25rem;
}

.settings-about-suisa-hero__img {
  display: block;
  width: min(88vw, 320px);
  height: auto;
  object-fit: contain;
}

.settings-about-suisa-prose {
  color: #6b7a52;
}

.settings-about-suisa-prose__lead {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.55;
  color: #6b7a52;
  letter-spacing: 0.01em;
}

.settings-about-suisa-prose p + p {
  margin-top: 1rem;
}

.settings-legal-prose__link:hover {
  color: rgb(14, 116, 144);
}

.settings-about-hub-grid {
  width: 100%;
  box-sizing: border-box;
}

.settings-about-hub-tile {
  min-width: 0;
}

/* 日記簿內頁（暖色、與設定入口區隔） */
.diary-book-screen {
  z-index: 45;
  background: #FFF9F6;
}

.diary-book-screen__header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(92, 74, 58, 0.12);
  background: rgba(255, 249, 246, 0.95);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.diary-book-screen__back {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(120, 90, 60, 0.22);
  background: rgba(212, 181, 140, 0.25);
  color: #5c4a3a;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button.diary-book-screen__back:not(:disabled):active,
button.diary-book-screen__back:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
  background: rgba(180, 145, 100, 0.42);
  border-color: rgba(120, 90, 60, 0.38);
}

.diary-book-screen__title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #4a3b30;
  letter-spacing: 0.06em;
  box-sizing: border-box;
  text-align: center;
  min-width: 0;
}

.diary-book-screen__header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 44px;
}

.diary-book-screen__search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(120, 90, 60, 0.22);
  background: rgba(212, 181, 140, 0.25);
  color: #5c4a3a;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.diary-book-screen__search-btn svg {
  width: 22px;
  height: 22px;
}

button.diary-book-screen__search-btn:not(:disabled):active,
button.diary-book-screen__search-btn:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
  background: rgba(180, 145, 100, 0.42);
  border-color: rgba(120, 90, 60, 0.38);
}

.diary-book-screen__search-btn--active {
  background: rgba(180, 145, 100, 0.42);
  border-color: rgba(120, 90, 60, 0.45);
  color: #4a3b30;
}

.diary-book-search-modal__panel {
  max-width: 22rem;
}

.diary-book-search-modal__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diary-book-search-modal__label {
  font-size: 13px;
  font-weight: 800;
  color: #5c4a3a;
}

.diary-book-search-modal__input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(120, 90, 60, 0.22);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #4a3b30;
  background: #fffdf8;
}

.diary-book-search-modal__error {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
  line-height: 1.45;
}

.diary-book-search-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.diary-book-search-modal__actions .btn {
  flex: 1;
  min-width: 0;
}

.diary-book-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(92, 74, 58, 0.1);
  background: #FFF9F6;
}

.diary-book-tabs__btn {
  flex: 1;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #6b5344;
  background: #FFF9F6;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.25;
}

.diary-book-tabs__btn--active {
  color: #fffdf8;
  background: #c9a882;
}

.diary-book-tabs__btn:not(.diary-book-tabs__btn--active):active {
  background: #f5eadc;
}

.diary-book-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  box-sizing: border-box;
}

.diary-book-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.diary-book-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid rgba(92, 74, 58, 0.1);
  background: #FFF9F6;
}

.diary-book-row__thumb {
  width: 5.25rem;
  min-width: 5.25rem;
  align-self: stretch;
  background: #efe6d8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: visible;
}

.diary-book-row__thumb img {
  width: 100%;
  height: 100%;
  min-height: 5.25rem;
  object-fit: cover;
  display: block;
}

.diary-book-row__thumb--fallback {
  background: linear-gradient(165deg, #f5eadc 0%, #efe6d8 100%);
  padding: 10px 8px;
  overflow: visible;
}

.diary-book-row__category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 5.25rem;
  padding: 4px;
  box-sizing: border-box;
  overflow: visible;
  color: rgba(92, 74, 58, 0.52);
}

.diary-book-row__icon-svg {
  width: 1.75rem;
  height: 1.75rem;
  display: block;
  flex-shrink: 0;
  margin: 0 auto;
  overflow: visible;
}

.diary-book-row__main {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FFF9F6;
  box-sizing: border-box;
}

.diary-book-row__date {
  font-size: 15px;
  font-weight: 900;
  color: #4a3b30;
  letter-spacing: 0.02em;
}

.diary-book-row__age {
  font-size: 12px;
  font-weight: 700;
  color: #6b5344;
}

.diary-book-row__body {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  color: #5c4a3a;
  word-break: break-word;
}

.diary-book-row__label {
  font-size: 11px;
  font-weight: 900;
  color: #7a5c45;
  margin-bottom: 2px;
}

.diary-book-row__block + .diary-book-row__block {
  margin-top: 8px;
}

.diary-book-empty {
  margin: 0;
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #7a6554;
  line-height: 1.6;
}

.diary-book-recommend {
  padding: 1.5rem 1.25rem;
}

.diary-book-recommend__text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #5c4a3a;
  line-height: 1.65;
  text-align: center;
}

.pet-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
  background-color: var(--bg);
}

.pet-detail-health-messages {
  border-radius: 0;
  border: none;
  background-color: transparent;
  padding: 0;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pet-detail-health-card {
  background-color: #ffffff;
}

.pet-detail-health-card.pet-detail-health-card--important-breathe,
.pet-detail-advice-card.pet-detail-advice-card--important-breathe {
  animation: pet-detail-health-card-breathe 2.8s ease-in-out infinite;
}

.pet-detail-health-card.pet-detail-health-card--normal-breathe,
.pet-detail-advice-card.pet-detail-advice-card--normal-breathe {
  animation: pet-detail-health-card-normal-breathe 2.8s ease-in-out infinite;
}

@keyframes pet-detail-health-card-breathe {
  0%,
  100% {
    border-color: rgba(244, 63, 94, 0.78);
    box-shadow:
      0 0 0 2px rgba(244, 63, 94, 0.28),
      0 1px 4px rgba(244, 63, 94, 0.14);
  }
  50% {
    border-color: rgba(225, 29, 72, 1);
    box-shadow:
      0 0 0 4px rgba(244, 63, 94, 0.38),
      0 0 0 8px rgba(244, 63, 94, 0.14),
      0 4px 18px rgba(244, 63, 94, 0.26);
  }
}

@keyframes pet-detail-health-card-normal-breathe {
  0%,
  100% {
    border-color: rgba(34, 211, 238, 0.78);
    box-shadow:
      0 0 0 2px rgba(34, 211, 238, 0.28),
      0 1px 4px rgba(34, 211, 238, 0.14);
  }
  50% {
    border-color: rgba(8, 145, 178, 1);
    box-shadow:
      0 0 0 4px rgba(34, 211, 238, 0.38),
      0 0 0 8px rgba(34, 211, 238, 0.14),
      0 4px 18px rgba(34, 211, 238, 0.26);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pet-detail-health-card.pet-detail-health-card--important-breathe,
  .pet-detail-advice-card.pet-detail-advice-card--important-breathe {
    animation: none;
    box-shadow:
      0 0 0 3px rgba(244, 63, 94, 0.32),
      0 1px 4px rgba(244, 63, 94, 0.14);
  }

  .pet-detail-health-card.pet-detail-health-card--normal-breathe,
  .pet-detail-advice-card.pet-detail-advice-card--normal-breathe {
    animation: none;
    box-shadow:
      0 0 0 3px rgba(34, 211, 238, 0.32),
      0 1px 4px rgba(34, 211, 238, 0.14);
  }
}

.pet-detail-advice-card__body {
  min-width: 0;
}

.pet-detail-advice-card__tags-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.pet-detail-advice-card__tags-row--dismiss-only {
  justify-content: flex-end;
}

.pet-detail-advice-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.pet-detail-advice-card__text {
  margin: 0;
}

.reminder-dismiss-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 2px;
  cursor: pointer;
  line-height: 0;
}

.reminder-dismiss-icon-btn:active {
  transform: scale(0.94);
}

.reminder-dismiss-icon-btn:focus-visible {
  outline: 2px solid rgba(8, 145, 178, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

.reminder-dismiss-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.reminder-dismiss-icon-btn--tags-row {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-left: auto;
}

.pet-detail-health-messages p {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.6;
  color: rgb(30, 41, 59);
}

.pet-detail-health-messages p:last-child {
  margin-bottom: 0;
}

.pet-detail-health-messages--empty {
  color: rgb(100, 116, 139);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.pet-detail-health-more-toggle {
  box-sizing: border-box;
  width: 100%;
  margin-top: 6px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  color: rgb(71, 85, 105);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}

.pet-detail-health-more-toggle:hover {
  color: rgb(15, 118, 110);
}

.pet-detail-health-more-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.22s ease, opacity 0.2s ease;
}

.pet-detail-health-more-wrap--collapsed {
  grid-template-rows: 0fr;
}

.pet-detail-health-more-inner {
  min-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.pet-detail-health-more-wrap--collapsed .pet-detail-health-more-inner {
  opacity: 0;
  pointer-events: none;
}

.pet-detail-health-more-wrap:not(.pet-detail-health-more-wrap--collapsed) .pet-detail-health-more-inner {
  overflow: visible;
  opacity: 1;
  margin-top: 4px;
}

#pet-detail-icons-dock.pet-detail-icons-dock,
#pet-detail-icons-dock.pet-detail-health-icons {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  list-style: none;
  background-color: var(--bg);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  touch-action: manipulation;
}

.pet-detail-icons-dock.hidden,
.pet-detail-icons-dock[hidden] {
  display: none !important;
}

.pet-detail-health-icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 16px;
  border: 1px solid rgba(2, 132, 199, 0.12);
  background-color: #ffffff;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  list-style: none;
  min-width: 0;
  pointer-events: auto;
  touch-action: manipulation;
}

.pet-detail-health-icon-tile__svg {
  width: 26px;
  height: 26px;
  color: rgb(8, 145, 178);
  flex-shrink: 0;
}

.pet-detail-health-icon-tile__label {
  font-size: 11px;
  font-weight: 800;
  color: rgb(71, 85, 105);
  text-align: center;
  line-height: 1.25;
}

.pet-detail-health-icon-tile--action {
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font: inherit;
  cursor: pointer;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}

.pet-detail-health-icon-tile--action:focus-visible {
  outline: 2px solid rgba(6, 182, 212, 0.55);
  outline-offset: 2px;
}

.pet-detail-health-icon-tile--action:active,
.pet-detail-health-icon-tile--action.is-tap-pressed {
  background-color: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.42);
  opacity: 1;
}

.pet-detail-health-icon-tile--triggered {
  background-color: #ffffff;
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18);
}

.pet-detail-content-stack {
  width: 100%;
  min-width: 0;
  background-color: var(--bg);
}

#pet-detail-layer-park {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(50%);
  contain: strict;
}

#pet-detail-layer-park .pet-detail-growth-chart-panel,
#pet-detail-layer-park .bg-white {
  background-color: transparent !important;
  box-shadow: none !important;
}

.pet-detail-layer-park .weight-growth-fab,
.pet-detail-layer-park .food-trend-fab {
  display: none !important;
}

.pet-detail-main-panel {
  width: 100%;
  min-width: 0;
  overflow: visible;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  background-color: var(--bg);
}

#pet-detail-screen .pet-detail-main-panel {
  padding: 16px;
  padding-bottom: 20px;
}

.pet-detail-native-ad-slot {
  width: 100%;
  margin-top: 16px;
  box-sizing: border-box;
}

.pet-detail-native-ad-slot__frame {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px dashed rgba(8, 145, 178, 0.28);
  background: rgba(255, 255, 255, 0.72);
  box-sizing: border-box;
}

.pet-detail-native-ad-slot__label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: rgba(100, 116, 139, 0.95);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  pointer-events: none;
  user-select: none;
}

.pet-detail-icons-dock--mobile-fixed {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 350 !important;
  margin: 0 !important;
  background-color: var(--bg) !important;
  box-shadow: none !important;
}

@media (hover: none) and (pointer: coarse) {
  #pet-detail-screen.pet-sub-screen:not(.hidden) {
    grid-template-rows: auto minmax(0, 1fr);
  }

  #pet-detail-screen > .pet-detail-content-stack {
    -webkit-overflow-scrolling: auto;
    transform: none;
    will-change: auto;
    padding-bottom: 188px;
    contain: paint;
  }

  #pet-detail-screen .pet-detail-main-panel {
    overflow: visible !important;
  }

  #pet-detail-icons-dock.pet-detail-health-icons {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .pet-detail-health-icon-tile {
    background-color: #ffffff !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}

.pet-detail-content-stack > .pet-detail-layer:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
}

.pet-detail-layer {
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.pet-detail-layer.hidden,
.pet-detail-layer[hidden],
.pet-detail-layer[aria-hidden="true"] {
  display: none !important;
}

.pet-detail-main-panel.hidden,
.pet-detail-main-panel[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.pet-detail-layer__inner {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* 成長曲線：Chart.js maintainAspectRatio:false 需父層有高度，否則手機上易擠壞版面 */
.pet-detail-growth-chart-panel {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: min(42vh, 300px);
  min-height: 220px;
  box-sizing: border-box;
  background-color: var(--bg);
}

.pet-detail-growth-chart-host {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.pet-detail-growth-chart-panel canvas,
.pet-detail-growth-chart-host canvas {
  display: block;
  max-width: 100% !important;
}

/* 體重時間軸：右欄在窄螢幕需可收縮，避免 flex 子項撐出水平捲軸 */
.pet-detail-weight-card > .flex-1 {
  min-width: 0;
}

.pet-detail-layer__inner--blank {
  background: var(--bg);
}

/* 舊版固定於螢幕底部，改為第一筆紀錄右側內嵌按鈕 */
.food-trend-fab {
  display: none !important;
}

#food-trend-modal {
  z-index: 400;
}

.food-trend-fab-inline {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  border: 1px solid rgba(2, 132, 199, 0.18);
  background: rgba(6, 182, 212, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.22);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.weight-growth-fab {
  position: fixed;
  right: 14px;
  bottom: calc(var(--bottom-fixed-offset) + 20px);
  z-index: 26;
  border: 1px solid rgba(2, 132, 199, 0.18);
  background: rgba(6, 182, 212, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.28);
}

.pet-detail-weight-strip {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  padding: 8px 12px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  list-style: none;
  margin: 0;
}

.pet-detail-weight-strip::-webkit-scrollbar {
  width: 5px;
}

.pet-detail-weight-strip::-webkit-scrollbar-thumb {
  background: rgba(107, 83, 68, 0.28);
  border-radius: 999px;
}

/* 體重時間軸專用樣式 */
.pet-detail-weight-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  /* 👇 拿掉 padding: 0 16px !important，改為以下兩行 👇 */
  padding-left: 16px !important; 
  padding-right: 16px !important;
}

/* 讓第一個圓點對齊右側文字 */
.pet-detail-weight-card:first-child .z-10 {
  margin-top: 4px;
}

/* 調整右側文字間距 */
.pet-detail-weight-card__weight {
  line-height: 1.2;
}

.pet-detail-weight-card:last-child {
  margin-bottom: 0;
}

.pet-detail-weight-card__main-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.pet-detail-weight-card__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pet-detail-weight-empty-actions {
  display: flex;
  justify-content: center;
  padding: 8px 20px 16px;
}

.pet-weight-update-modal__panel {
  max-width: 400px;
}

.pet-weight-update-modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pet-weight-update-modal__pet-name {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  text-align: center;
}

.pet-weight-update-modal__save {
  width: 100%;
  margin-top: 4px;
}

.pet-detail-weight-card__thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px dashed #d4c9be;
  background: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(107, 83, 68, 0.35);
  box-sizing: border-box;
}

.pet-detail-weight-card__thumb svg {
  width: 28px;
  height: 28px;
}

.pet-detail-weight-card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
}

.pet-detail-weight-card__date {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #5c4033;
  letter-spacing: 0.02em;
  line-height: 1.35;
  box-sizing: border-box;
}

.pet-detail-weight-card__weight {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #7a5e4b;
  line-height: 1.4;
  box-sizing: border-box;
}

.pet-detail-layer-empty {
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  color: rgb(100, 116, 139);
  box-sizing: border-box;
}

.pet-card__body {
  margin-top: 14px;
  box-sizing: border-box;
}

/* Enable linebreak and flexible layout for .pet-row and its children */
.pet-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 12px;
  border-radius: 16px;
  background: rgba(2, 132, 199, 0.04);
  border: 1px solid rgba(2, 132, 199, 0.08);
  flex-wrap: wrap;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
}

.pet-row + .pet-row {
  margin-top: 10px;
}

.pet-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  min-width: 0;
  word-break: break-word;
  word-wrap: break-word;
  flex: 1 1 90px;
  white-space: pre-line;
  box-sizing: border-box;
}

.pet-value {
  font-weight: 900;
  font-size: 15px;
  text-align: right;
  min-width: 0;
  word-break: break-word;
  word-wrap: break-word;
  flex: 2 1 120px;
  white-space: pre-line;
  box-sizing: border-box;
}

.empty-state {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.02);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
}

.bottom-chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}

.bottom-nav {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 1;
  display: flex;
  justify-content: space-around;
  gap: 6px;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}

.bottom-ad-banner {
  width: 100%;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

.bottom-ad-banner .adsbygoogle {
  display: inline-block;
  width: 320px;
  height: 50px;
}

body.bottom-ad-banner-enabled {
  --bottom-ad-banner-height: 50px;
}

body.bottom-ad-banner-enabled .pet-page {
  padding-bottom: calc(56px + var(--bottom-ad-banner-height) + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 639px) {
  body.bottom-ad-banner-enabled #tab-diary {
    padding-bottom: 9.5rem;
  }

  body.bottom-ad-banner-enabled #tab-settings {
    padding-bottom: 9.5rem;
  }

  body.bottom-ad-banner-enabled #tab-album {
    padding-bottom: 13.5rem;
    height: calc(100dvh - 13.5rem - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 13.5rem - env(safe-area-inset-bottom, 0px));
  }

  body.bottom-ad-banner-enabled #tab-family {
    padding-bottom: 13.5rem;
  }

  body.bottom-ad-banner-enabled #tab-album:not(.hidden) .album-pet-selector--dock {
    bottom: var(--bottom-fixed-offset);
  }

  body.bottom-ad-banner-enabled #tab-family:not(.hidden) .family-context-switcher--dock {
    bottom: var(--bottom-fixed-offset);
  }
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  box-sizing: border-box;
}

.nav-btn__icon {
  display: flex;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.nav-btn__icon > svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-btn--active {
  color: rgb(8, 145, 178);
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.24);
}

/* 隱藏橫向捲軸（與日記毛孩列 class 名稱一致） */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* 成長相冊主區：裁切外框滑動時不溢出 */
/* 成長相冊標題列：標題置中、新增按鈕靠右 */
#tab-album .album-screen__header {
  display: grid !important;
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  box-sizing: border-box;
}

#tab-album .album-screen__header-actions {
  position: relative;
  justify-self: end;
  grid-column: 3;
}

#tab-album #album-add-button {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
}

/* 家庭頁標題列：有管理按鈕時標題靠左省略，無按鈕時置中 */
#tab-family .family-screen__header {
  display: grid !important;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  box-sizing: border-box;
}

#tab-family .family-screen__title {
  grid-column: 1 / -1;
  justify-self: center;
  text-align: center;
}

#tab-family .family-screen__header--with-actions .family-screen__title {
  grid-column: 1;
  justify-self: start;
  text-align: left;
}

#tab-family .family-screen__actions:not(.hidden) {
  display: flex;
}

.album-main-swipe-area {
  overflow-x: hidden;
  touch-action: pan-y;
}

/* 成長相冊：仿實體相片白邊與紙質陰影 */
.album-photo-frame {
  margin: 0;
  padding: 10px 10px 14px;
  border-radius: 3px;
  background: linear-gradient(165deg, #ffffff 0%, #f3f4f6 100%);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 12px 28px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

.album-photo-frame--swipeable {
  will-change: transform;
}

.album-photo-frame__inner {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 2px 24px rgba(0, 0, 0, 0.35);
  min-height: 15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.album-photo-frame__img {
  display: block;
  box-sizing: border-box;
}

.album-photo-frame__empty {
  margin: 0;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
}

.album-photo-frame__caption {
  margin: 10px 0 0;
  padding: 0 4px;
  box-sizing: border-box;
}

/* 成長相冊底部：日期＋縮圖橫向「膠卷」捲動 */
.album-filmstrip {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 16px calc(50% - 2.5rem) !important;
}

.album-filmstrip__btn {
  flex: 0 0 auto;
  scroll-snap-align: center;
  width: 4.5rem;
  min-width: 4.5rem;
  padding: 6px 6px 8px;
  border-radius: 100px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.45;
  transform: scale(0.85);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

/* 僅日期、無縮圖 */
.album-filmstrip__btn--date-only {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: auto;
  min-width: 4.5rem;
  padding: 10px 16px;
}

.album-filmstrip__btn:hover {
  opacity: 0.7;
  transform: scale(0.95);
}

.album-filmstrip__btn--active,
.album-filmstrip__btn--active:hover {
  opacity: 1;
  transform: scale(1.2);
  background: #ffffff;
  border-color: rgba(245, 201, 52, 0.8);
  box-shadow: 0 8px 24px rgba(245, 201, 52, 0.25), inset 0 0 0 1px rgba(245, 201, 52, 0.08);
  z-index: 10;
}

.album-filmstrip__btn--active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(245, 201, 52, 0.85);
}

/* 縮圖外框 */
.album-filmstrip__thumb-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
  box-sizing: border-box;
}

/* 縮圖圖片 */
.album-filmstrip__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
}

.album-filmstrip__date {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  line-height: 1.2;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  transition: color 0.3s ease;
}

.album-filmstrip__btn--date-only .album-filmstrip__date {
  width: auto;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.album-filmstrip__btn--active .album-filmstrip__date {
  color: #F5C934;
}

@media (min-width: 640px) {
  .album-filmstrip__btn:not(.album-filmstrip__btn--date-only) {
    width: 5rem;
    min-width: 5rem;
  }

  .album-filmstrip__date {
    font-size: 11px;
  }

  .album-filmstrip__btn--date-only .album-filmstrip__date {
    font-size: 13px;
  }
}

/* 日記月曆格線：手機均分列高且可縮至 0，避免 min-height 與 1fr 衝突造成重疊／溢出 */
@media (max-width: 639px) {
  #tab-diary:not(.hidden) .diary-calendar-grid--fill-rows {
    grid-auto-rows: minmax(0, 1fr);
  }
}

@media (min-width: 640px) {
  .diary-calendar-grid.diary-calendar-grid--fill-rows {
    grid-auto-rows: min-content;
  }
}

/* 日記行事曆：手機上將 All／毛孩篩選列固定於底部導覽列正上方，釋放月曆垂直空間 */
@media (max-width: 639px) {
  #tab-diary:not(.hidden) .diary-pet-selector--dock {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 32rem;
    bottom: calc(var(--bottom-fixed-offset) + 2px);
    z-index: 19;
    padding: 6px 10px 10px;
    box-sizing: border-box;
    /* 與主畫面背景一致：不另加白底條，僅保留各標籤自身底色 */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
    box-shadow: none;
  }
}

/* 成長相冊：將名字標籤固定在導覽列正上方，不遮擋內容 */
@media (max-width: 639px) {
  #tab-album:not(.hidden) .album-pet-selector--dock {
    position: fixed;
    left: 0;
    right: 0;
    /* 1. 直接對齊 66px，拿掉 env() 以完全吻合我的毛孩頁面 */
    bottom: 66px;
    z-index: 40;
    /* 2. 強制覆蓋 HTML 中的 py-1.5，將外層間距改為 0 */
    padding: 0 14px !important;
    background: transparent;
    border-top: none;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    pointer-events: none;
  }

  #tab-album:not(.hidden) #album-pet-switcher {
    pointer-events: auto;
    /* 3. 強制讓內部容器的留白跟「我的毛孩」(.pet-name-chip-row) 完全一致 */
    padding: 8px 2px !important;
    margin: 0 !important;
  }

  #tab-family:not(.hidden) .family-context-switcher--dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 66px;
    z-index: 40;
    margin: 0 12px;
    box-sizing: border-box;
  }
}

.tab {
  margin-top: 18px;
  box-sizing: border-box;
}

.section-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 900;
  box-sizing: border-box;
}

.section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
}

.add-pet-breed-picker-modal {
  z-index: 60;
}

.add-pet-breed-picker-modal .modal__header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  column-gap: 8px;
}

.add-pet-breed-picker-title {
  grid-column: 2;
  margin: 0;
  width: 100%;
  text-align: center;
  justify-self: center;
}

#add-pet-breed-picker-back {
  grid-column: 1;
  justify-self: start;
}

#add-pet-breed-picker-close {
  grid-column: 3;
  justify-self: end;
}

.add-pet-breed-picker-back--concealed {
  visibility: hidden;
  pointer-events: none;
}

.add-pet-breed-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.add-pet-breed-trigger--empty {
  color: #94a3b8;
}

.add-pet-breed-trigger:disabled {
  pointer-events: none;
}

.add-pet-breed-picker-hint {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

.add-pet-species-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.add-pet-species-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 12px 8px;
  border: 1px solid rgba(245, 201, 52, 0.35);
  border-radius: 18px;
  background: rgba(245, 201, 52, 0.12);
  color: #334155;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.add-pet-species-btn:active {
  transform: translateY(1px);
}

.add-pet-species-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.add-pet-species-btn__icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.add-pet-species-btn__label {
  font-size: 14px;
  font-weight: 900;
}

.add-pet-breed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-pet-breed-list__group-label {
  margin: 4px 0 0;
  padding: 6px 4px 2px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #94a3b8;
  text-transform: none;
  box-sizing: border-box;
}

.add-pet-breed-list__group-label:first-child {
  margin-top: 0;
}

.add-pet-breed-list__item {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  box-sizing: border-box;
}

.add-pet-breed-list__item--active {
  border-color: rgba(6, 182, 212, 0.45);
  background: rgba(6, 182, 212, 0.08);
  color: #0e7490;
}

.add-pet-breed-list__item:active {
  transform: translateY(1px);
}

.add-pet-breed-list-empty {
  margin: 0;
  padding: 16px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.add-pet-breed-list__mix-entry {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.add-pet-breed-list__mix-btn {
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed rgba(6, 182, 212, 0.45);
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.06);
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  color: #0e7490;
  cursor: pointer;
  box-sizing: border-box;
}

.add-pet-breed-list__mix-btn:active {
  transform: translateY(1px);
}

.add-pet-mix-quiz-modal {
  z-index: 70;
}

.add-pet-mix-quiz-modal .modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.add-pet-mix-quiz-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.add-pet-mix-quiz__question {
  margin: 0;
}

.add-pet-mix-quiz__question-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  color: #334155;
}

.add-pet-mix-quiz__options {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-pet-mix-quiz__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.add-pet-mix-quiz__option--selected {
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(6, 182, 212, 0.08);
}

.add-pet-mix-quiz__option-input {
  margin-top: 3px;
  flex-shrink: 0;
}

.add-pet-mix-quiz__option-key {
  flex-shrink: 0;
  width: 1.25rem;
  font-size: 13px;
  font-weight: 900;
  color: #0e7490;
}

.add-pet-mix-quiz__option-label {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #475569;
}

.add-pet-mix-quiz-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.add-pet-mix-quiz-error {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #e11d48;
}

.add-pet-mix-quiz-submit {
  width: 100%;
}

.add-pet-mix-quiz__followup-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  color: #334155;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  box-sizing: border-box;
}

.modal__panel {
  position: relative;
  width: 95%;
  max-width: 520px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 0 0;
  max-height: min(92vh, calc(100vh - env(safe-area-inset-top) - 16px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 16px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.modal__body::-webkit-scrollbar {
  width: 8px;
}

.modal__body::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.22);
  border-radius: 999px;
}

.modal__body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
}

.modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  box-sizing: border-box;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.field__label {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  box-sizing: border-box;
}

.field__hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  box-sizing: border-box;
}

.input--file {
  padding: 10px 12px;
  cursor: pointer;
  box-sizing: border-box;
}

.input,
select.input {
  width: 100%;
  max-width: 100%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.02);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.input:focus {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
}

.form__actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  box-sizing: border-box;
}

.form__actions .btn--primary {
  flex: 1;
  box-sizing: border-box;
}

.form__actions .btn--ghost {
  min-width: 92px;
  box-sizing: border-box;
}

.pet-page {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  min-height: calc(100dvh - 168px);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  /* 預留右下角固定「毛孩衛教」列，專屬建議與下方卡片捲動時不會被遮住（可改小／改大） */
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;

  /*
   * 我的毛孩頁固定版面（以「大頭貼 + 標題 + 體重提醒 + 建議列表」皆存在時為基準）
   * --pet-expert-wrap-margin-top：建議區離大頭貼下緣（越小越靠上，可用負值）
   * --pet-expert-panel-padding-top：標題／體重提醒整塊往下偏移
   */
  --pet-layout-photo-size: min(300px, 76vw);
  --pet-layout-title-slot-height: 42px;
  --pet-layout-weight-stale-slot-height: 40px;
  --pet-layout-list-slot-height: 108px;
  --pet-expert-wrap-margin-top: -6px;
  --pet-expert-panel-padding-top: 10px;
  --pet-expert-gap-title-to-weight: 10px;
  --pet-expert-gap-weight-to-list: 6px;
  --pet-expert-list-padding-block-start: 4px;
  --pet-layout-advice-panel-height: calc(
    var(--pet-expert-panel-padding-top) + var(--pet-layout-title-slot-height) +
      var(--pet-expert-gap-title-to-weight) + var(--pet-layout-weight-stale-slot-height) +
      var(--pet-expert-gap-weight-to-list) + var(--pet-layout-list-slot-height)
  );
  --pet-layout-main-min-height: calc(
    var(--pet-layout-photo-size) + var(--pet-layout-advice-panel-height) + var(--pet-expert-wrap-margin-top)
  );
}

/* 我的毛孩頁：使用教學（蠟筆箭頭 + 小卡） */
.pets-page-tutorial-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(-66px - env(safe-area-inset-bottom, 0px));
  z-index: 200;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  pointer-events: auto;
  border-radius: 28px;
  overflow: hidden;
  box-sizing: border-box;
}

.pets-page-tutorial-coach-card {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 28rem;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  pointer-events: auto;
  box-sizing: border-box;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.28);
}

.pets-page-tutorial-coach-card #settings-tutorial-coach-step {
  color: #d1fae5;
}

.pets-page-tutorial-coach-card #settings-tutorial-coach-title {
  color: #f8fafc;
}

.pets-page-tutorial-coach-card #settings-tutorial-coach-body {
  color: #e2e8f0;
}

.pets-page-tutorial-coach-card [data-i18n="settings.tutorialCoachSwipeHint"] {
  color: #bfdbfe;
}

.pets-page-tutorial-coach-card #settings-tutorial-coach-close,
.pets-page-tutorial-coach-card #settings-tutorial-coach-prev {
  border-color: rgba(226, 232, 240, 0.45);
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.24);
}

.pets-page-tutorial-coach-card #settings-tutorial-coach-next {
  background: rgba(56, 189, 248, 0.88);
  color: #082f49;
}

.tutorial-image-board {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.tutorial-image-board__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 28px;
  color: #0f172a;
}

.tutorial-image-board__row svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.settings-tutorial-card-list {
  display: grid;
  gap: 12px;
}

.family-share-guide-modal {
  /* 高於 .pet-sub-screen (300)，使用教學開啟時也要能蓋在上面 */
  z-index: 350;
}

.family-share-guide-modal__backdrop {
  border: none;
  background: transparent;
  padding: 0;
}

.family-share-guide__title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: #0e7490;
  text-align: center;
  line-height: 1.45;
}

.family-share-guide__list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.family-share-guide__list li {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  line-height: 1.55;
}

.family-share-guide-success-body__main {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 900;
  color: #0e7490;
  text-align: center;
  line-height: 1.55;
}

.family-share-guide-success-body__hint {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  line-height: 1.5;
  text-align: center;
}

.family-share-guide__nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.25);
  background: rgba(236, 254, 255, 0.9);
  color: #0e7490;
  flex-shrink: 0;
}

.family-share-guide__nav-icon svg {
  display: block;
}

.settings-tutorial-slider-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px calc(18px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.settings-tutorial-slider-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

.settings-tutorial-slider-modal__panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  border-radius: 18px;
  background: rgba(255, 249, 246, 0.96);
  padding: 0;
  box-shadow: 0 16px 32px rgba(51, 51, 51, 0.18);
  overflow: hidden;
}

.settings-tutorial-slider-track {
  display: flex;
  width: 100%;
  transition: transform 240ms ease;
  touch-action: pan-y;
}

.settings-tutorial-slide {
  width: 100%;
  flex: 0 0 100%;
  padding: 0;
  box-sizing: border-box;
}

.settings-tutorial-slide__image {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 0;
  vertical-align: top;
}

.settings-tutorial-slider-modal__actions {
  margin-top: 0;
  padding: 10px 12px 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Warm theme override */
:root {
  --warm-bg-soft: #f9f2d4;
  --warm-bg-hover: #fffaf2;
  --warm-border: #efcf9b;
  --warm-text-strong: #333333;
}

.btn--primary {
  background: #e89313;
}

.btn--primary:hover {
  background: #F5C934;
}

.nav-btn--active {
  color: #F5C934;
  background: rgba(245, 201, 52, 0.14);
  border-color: rgba(245, 201, 52, 0.32);
}

.text-brand,
.text-brand-strong {
  color: #F5C934 !important;
}

.text-cyan-900,
.text-cyan-800 {
  color: #333333 !important;
}

.text-cyan-700,
.text-cyan-600 {
  color: #F5C934 !important;
}

.bg-cyan-50 {
  background-color: #f9f2d4 !important;
}

.bg-cyan-100 {
  background-color: #fffaf2 !important;
}

.bg-cyan-600 {
  background-color: #e89313 !important;
}

.hover\:bg-cyan-50:hover,
.hover\:bg-cyan-50\/50:hover {
  background-color: #f9f2d4 !important;
}

.hover\:bg-cyan-100:hover {
  background-color: #fffaf2 !important;
}

.border-cyan-100,
.border-cyan-100\/80 {
  border-color: #efcf9b !important;
}

.border-cyan-200,
.border-cyan-200\/80 {
  border-color: #e5bd83 !important;
}

.shadow-cyan-900\/5,
.shadow-cyan-900\/10 {
  --tw-shadow-color: rgba(245, 201, 52, 0.18) !important;
}

/* Settings language modal: warm theme */
#settings-language-modal .modal__overlay {
  background: rgba(51, 51, 51, 0.42);
}

#settings-language-modal .modal__panel {
  background: #fff9f6;
  border: 1px solid rgba(245, 201, 52, 0.28);
}

#settings-language-modal .modal__header {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(245, 201, 52, 0.22);
  padding-bottom: 10px;
}

#settings-language-modal .modal__title {
  color: #333333;
}

#settings-language-modal .modal__body {
  background: #fff9f6;
}

#settings-language-modal #lang-en {
  border-color: rgba(245, 201, 52, 0.28) !important;
  background: #fffffc !important;
  color: #333333 !important;
}

#settings-language-modal #lang-en:hover {
  background: #fffaf2 !important;
}

/* Diary calendar: keep multi-color chips/icons for readability */
#tab-diary .bg-cyan-100 {
  background-color: #cffafe !important;
}

#tab-diary .text-cyan-800 {
  color: #155e75 !important;
}

#tab-diary .border-cyan-200 {
  border-color: #a5f3fc !important;
}

#tab-diary .ring-cyan-500 {
  --tw-ring-color: #06b6d4 !important;
}

/* Album pet switcher: keep same multi-color palette as diary */
#tab-album .bg-cyan-100 {
  background-color: #cffafe !important;
}

#tab-album .text-cyan-800 {
  color: #155e75 !important;
}

#tab-album .border-cyan-200 {
  border-color: #a5f3fc !important;
}

#tab-album .ring-cyan-500 {
  --tw-ring-color: #06b6d4 !important;
}

/* Pet detail main panel: keep "一般" tag in blue */
#pet-detail-main-panel .bg-cyan-600 {
  background-color: #0891b2 !important;
}

#pet-detail-main-panel .border-cyan-200 {
  border-color: #bae6fd !important;
}

#pet-detail-main-panel .bg-cyan-50\/70 {
  background-color: rgba(186, 230, 253, 0.55) !important;
}

#pet-detail-main-panel .text-cyan-900 {
  color: #0c4a6e !important;
}

/* Diary calendar date bottom text: keep gray scale */
#tab-diary .diary-day-cell span:last-child {
  color: #64748b !important;
}

#tab-diary .diary-day-cell--today span:last-child {
  color: #475569 !important;
}

#tab-diary .diary-day-cell {
  background-color: #fffff8 !important;
}

/* 分頁可點擊元件：shape-aware 按壓回饋（圓角內加深，非方形暗層） */
:is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled),
.diary-flow-modal button:not(:disabled),
.pet-page .pet-name-chip,
.pet-page .pet-name-chip-nav {
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  isolation: isolate;
}

:is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled):not(.absolute),
.diary-flow-modal button:not(:disabled),
.pet-page .pet-name-chip,
.pet-page .pet-name-chip-nav {
  position: relative;
}

:is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled)::before,
.diary-flow-modal button:not(:disabled)::before,
.pet-page .pet-name-chip::before,
.pet-page .pet-name-chip-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: transparent;
  pointer-events: none;
  z-index: 2;
  transition: background-color 0.12s ease;
}

:is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled):active,
:is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled).is-tap-pressed,
#tab-diary button:not(:disabled).diary-day-cell--tap-feedback,
.diary-flow-modal button:not(:disabled):active,
.diary-flow-modal button:not(:disabled).is-tap-pressed,
.diary-flow-modal button:not(:disabled).diary-pet-picker-tile--tap-feedback,
.pet-page .pet-name-chip:not(:disabled):active,
.pet-page .pet-name-chip:not(:disabled).is-tap-pressed,
.pet-page .pet-name-chip-nav:not(:disabled):active,
.pet-page .pet-name-chip-nav:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
}

:is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled):active::before,
:is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled).is-tap-pressed::before,
#tab-diary button:not(:disabled).diary-day-cell--tap-feedback::before,
.diary-flow-modal button:not(:disabled):active::before,
.diary-flow-modal button:not(:disabled).is-tap-pressed::before,
.diary-flow-modal button:not(:disabled).diary-pet-picker-tile--tap-feedback::before,
.pet-page .pet-name-chip:not(:disabled):active::before,
.pet-page .pet-name-chip:not(:disabled).is-tap-pressed::before,
.pet-page .pet-name-chip-nav:not(:disabled):active::before,
.pet-page .pet-name-chip-nav:not(:disabled).is-tap-pressed::before {
  background-color: rgba(15, 23, 42, 0.1);
}

.diary-flow-modal .diary-flow-icon-btn:not(:disabled):active::before,
.diary-flow-modal .diary-flow-icon-btn:not(:disabled).is-tap-pressed::before,
.diary-flow-modal .diary-flow-submit-btn:not(:disabled):active::before,
.diary-flow-modal .diary-flow-submit-btn:not(:disabled).is-tap-pressed::before {
  background-color: rgba(92, 74, 58, 0.14);
}

.pet-page .pet-name-chip--active:not(:disabled):active::before,
.pet-page .pet-name-chip--active:not(:disabled).is-tap-pressed::before {
  background-color: rgba(245, 201, 52, 0.22);
}

/* 成長相冊膠卷：保留縮放層級，僅疊加深色回饋 */
#tab-album .album-filmstrip__btn:not(:disabled):active,
#tab-album .album-filmstrip__btn:not(:disabled).is-tap-pressed {
  opacity: 0.45;
  transform: scale(0.82);
}

#tab-album .album-filmstrip__btn--active:not(:disabled):active,
#tab-album .album-filmstrip__btn--active:not(:disabled).is-tap-pressed {
  opacity: 1;
  transform: scale(1.14);
}

@media (prefers-reduced-motion: reduce) {
  :is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled):active,
  :is(#tab-diary, #tab-album, #tab-settings) button:not(:disabled).is-tap-pressed,
  #tab-diary button:not(:disabled).diary-day-cell--tap-feedback,
  .diary-flow-modal button:not(:disabled):active,
  .diary-flow-modal button:not(:disabled).is-tap-pressed,
  .diary-flow-modal button:not(:disabled).diary-pet-picker-tile--tap-feedback,
  .pet-page .pet-name-chip:not(:disabled):active,
  .pet-page .pet-name-chip:not(:disabled).is-tap-pressed,
  .pet-page .pet-name-chip-nav:not(:disabled):active,
  .pet-page .pet-name-chip-nav:not(:disabled).is-tap-pressed,
  #tab-album .album-filmstrip__btn:not(:disabled):active,
  #tab-album .album-filmstrip__btn:not(:disabled).is-tap-pressed,
  #tab-album .album-filmstrip__btn--active:not(:disabled):active,
  #tab-album .album-filmstrip__btn--active:not(:disabled).is-tap-pressed {
    transform: none;
  }
}

#tab-diary .diary-day-cell.bg-cyan-50\/90,
#tab-diary .diary-day-cell--today {
  background-color: #fffff8 !important;
}

#diary-calendar-card {
  background-color: #fffff8 !important;
  border-color: rgba(180, 150, 120, 0.28) !important;
  box-shadow: 0 10px 24px rgba(92, 74, 58, 0.12) !important;
}

#tab-diary {
  overflow-y: hidden;
  padding-bottom: 1.25rem !important;
}


/* 有名字列時預留頂部空間（名字列為 fixed，不占文件流） */
.pet-page:has(#pet-name-switcher:not(.hidden)) {
  padding-top: calc(46px + env(safe-area-inset-top, 0px));
}

/* 照片＋專屬建議：固定槽位，內容多寡不影響大頭貼／標題／列表垂直位置 */
.pet-page .pet-page-main {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: var(--pet-layout-main-min-height);
  min-height: var(--pet-layout-main-min-height);
  box-sizing: border-box;
}

.pet-page .pet-page-main > .pet-photo-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--pet-layout-photo-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0;
  margin-bottom: 0;
  box-sizing: border-box;
}

.pet-page .pet-expert-advice-wrap {
  position: absolute;
  top: calc(var(--pet-layout-photo-size) + var(--pet-expert-wrap-margin-top));
  left: 0;
  right: 0;
  height: var(--pet-layout-advice-panel-height);
  min-height: var(--pet-layout-advice-panel-height);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(360px, 100%);
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  box-sizing: border-box;
}

.pet-page .pet-expert-advice-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: var(--pet-layout-advice-panel-height);
  min-height: var(--pet-layout-advice-panel-height);
  padding-top: var(--pet-expert-panel-padding-top, 0px);
  box-sizing: border-box;
  gap: 0;
}

.pet-page .pet-expert-advice-slot-hidden {
  visibility: hidden;
  pointer-events: none;
}

.pet-page .pet-expert-advice-title-card {
  flex: 0 0 var(--pet-layout-title-slot-height);
  min-height: var(--pet-layout-title-slot-height);
  margin-bottom: var(--pet-expert-gap-title-to-weight);
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(165, 243, 252, 0.55);
  padding: 8px 12px;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

.pet-page #expert-advice-container.pet-expert-advice {
  position: relative;
  flex: 0 0 var(--pet-layout-list-slot-height);
  display: flex;
  flex-direction: column;
  min-height: var(--pet-layout-list-slot-height);
  height: var(--pet-layout-list-slot-height);
  overflow: hidden;
  border: none;
  border-radius: 0;
  padding: 0 2px 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

.pet-page .expert-weight-stale-box {
  flex: 0 0 var(--pet-layout-weight-stale-slot-height);
  min-height: var(--pet-layout-weight-stale-slot-height);
  max-height: var(--pet-layout-weight-stale-slot-height);
  width: 100%;
  margin-bottom: var(--pet-expert-gap-weight-to-list);
  padding: 0 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  overflow: hidden;
  box-sizing: border-box;
}

.pet-page #expert-advice-list {
  flex: 1 1 auto;
  min-height: var(--pet-layout-list-slot-height);
  max-height: var(--pet-layout-list-slot-height);
  margin: 0;
  padding: var(--pet-expert-list-padding-block-start, 0px) 0 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  list-style: none;
  padding-left: 0;
  box-sizing: border-box;
}

.pet-page #expert-advice-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.pet-page .expert-advice-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  list-style: none;
}

.pet-page .expert-advice-list-item__alert-badge {
  flex-shrink: 0;
  margin-top: -1px;
  color: #f59e0b;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: expert-advice-alert-breathe 2s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes expert-advice-alert-breathe {
  0%,
  100% {
    color: #f59e0b;
    text-shadow: 0 0 4px rgba(245, 158, 11, 0.35);
    transform: scale(1);
  }
  50% {
    color: #fbbf24;
    text-shadow:
      0 0 10px rgba(251, 191, 36, 0.9),
      0 0 20px rgba(245, 158, 11, 0.45);
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pet-page .expert-advice-list-item__alert-badge {
    animation: none;
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.55);
  }
}

.pet-page .expert-advice-list-item__text {
  flex: 1 1 auto;
  min-width: 0;
}

.reminder-dismiss-btn {
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  padding: 4px 10px;
  cursor: pointer;
}

.reminder-dismiss-btn:active {
  transform: scale(0.98);
}

.reminder-dismiss-btn--card {
  font-size: 12px;
  padding: 5px 12px;
}

.expert-growth-message-box__text {
  margin: 0;
}

.expert-growth-message-box__action {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

/* Growth 訊息固定於右下，位於毛孩衛教入口上方 */
.pet-page #expert-growth-message-box {
  position: fixed;
  right: 12px;
  bottom: calc(var(--bottom-fixed-offset) + 56px);
  z-index: 24;
  width: min(320px, calc(100vw - 24px));
}

.pet-photo-viewport-wrap {
  position: relative;
  width: min(300px, 76vw);
  height: min(300px, 76vw);
  margin: 0 auto;
  flex-shrink: 0;
  box-sizing: border-box;
}

.pet-photo-viewport {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  cursor: grab;
  box-sizing: border-box;
}

.pet-avatar-fab {
  position: absolute;
  bottom: 4px;
  right: 4px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(245, 201, 52, 0.3);
  background: rgba(255, 248, 238, 0.95);
  color: #F5C934;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(245, 201, 52, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.pet-avatar-fab:active {
  transform: translateY(1px);
}

.pet-avatar-fab__svg {
  width: 21px;
  height: 21px;
  display: block;
  box-sizing: border-box;
}

.pet-photo-viewport:active {
  cursor: grabbing;
}

.pet-photo-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 260ms ease;
  box-sizing: border-box;
}

.pet-photo-track.swiping {
  transition: none;
}

.pet-photo-slide {
  flex: 0 0 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
}

.pet-photo-circle {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 9999px;
  overflow: hidden;
  border: 2px solid rgba(245, 201, 52, 0.28);
  background: rgba(245, 201, 52, 0.1);
  box-shadow: 0 18px 45px rgba(245, 201, 52, 0.16);
  transform: translateY(0);
  animation: pet-floaty 3.2s ease-in-out infinite;
  box-sizing: border-box;
}

.pet-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
}

.pet-photo-circle__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 42px;
  color: rgba(245, 201, 52, 0.96);
  background: radial-gradient(circle at 30% 20%, rgba(245, 201, 52, 0.26), transparent 55%);
  box-sizing: border-box;
}

@keyframes pet-floaty {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (hover: hover) {
  .pet-photo-circle:hover {
    animation-duration: 2.6s;
    box-shadow: 0 22px 60px rgba(245, 201, 52, 0.24);
    filter: saturate(1.05);
  }
}

/* 我的毛孩：名字列（fixed 左上至中央前停止，右側留給通知／＋；可視約 3 格、無捲軸） */
.pet-page .pet-name-switcher:not(.hidden) {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: calc(15px + env(safe-area-inset-top, 0px));
  right: calc(16px + 44px + 10px + 44px + 12px + env(safe-area-inset-right, 0px));
  z-index: 25;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  pointer-events: auto;
  box-sizing: border-box;
}

.pet-page .pet-name-switcher {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  box-sizing: border-box;
}

.pet-page .pet-name-chip-nav {
  flex-shrink: 0;
  width: 28px;
  height: 32px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(51, 51, 51, 0.32);
  background: #ffffff;
  color: #333333;
  box-shadow: 0 6px 16px rgba(51, 51, 51, 0.12);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pet-page .pet-name-chip-nav:disabled {
  opacity: 0.32;
  cursor: default;
}

.pet-page .pet-name-chip-viewport {
  container-type: inline-size;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  box-sizing: border-box;
}

.pet-page .pet-name-chip-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: max-content;
  min-height: 32px;
  padding: 2px 0;
  box-sizing: border-box;
}

.pet-page .pet-name-chip {
  flex: 0 0 calc((100cqw - 12px) / 3);
  max-width: calc((100cqw - 12px) / 3);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 5px 8px;
  font-weight: 900;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

@supports not (width: 1cqw) {
  .pet-page .pet-name-chip-viewport {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .pet-page .pet-name-chip {
    flex: 0 0 68px;
    max-width: 68px;
  }
}

.pet-page .pet-name-chip--active {
  color: #333333;
  border-color: rgba(245, 201, 52, 0.9);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(245, 201, 52, 0.28);
  box-sizing: border-box;
}

.required {
  color: #ff4d4f; /* 漂亮的紅色 */
  margin-left: 4px;
  font-weight: bold;
}

/* 日記分頁：橫向日期滾輪捲軸（搭配 Tailwind 版面） */
.diary-date-strip {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.25) rgba(15, 23, 42, 0.06);
}

.diary-date-strip::-webkit-scrollbar {
  height: 6px;
}

.diary-date-strip::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.22);
  border-radius: 999px;
}

.diary-date-strip::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
}

/* 日記細項表單：區塊標籤單排橫向捲動（不換行、超出可左右滑） */
.diary-category-tabs-nav.flex {
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* 日記登錄／細項表單：較柔和、低對比的捲軸 */
.diary-soft-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 74, 58, 0.22) transparent;
}

.diary-soft-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.diary-soft-scroll::-webkit-scrollbar-thumb {
  background: rgba(92, 74, 58, 0.2);
  border-radius: 999px;
}

.diary-soft-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 74, 58, 0.32);
}

.diary-soft-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* 分類拼圖：僅保留按下回饋，不亮起 */
.diary-puzzle-btn {
  cursor: pointer;
}

.diary-flow-modal .diary-puzzle-btn:not(:disabled):active,
.diary-flow-modal .diary-puzzle-btn:not(:disabled).is-tap-pressed {
  transform: scale(0.96);
}

.diary-puzzle-btn .diary-puzzle-check {
  opacity: 0.45;
}

/* 分類紀錄四格：於 HTML 為 img 設定 src 後覆蓋底色 */
.diary-category-photo-slot-img[src=""] {
  display: none;
}

.diary-category-photo-slot-img:not([src=""]) {
  display: block;
  object-fit: contain;
  object-position: center;
}

.diary-photo-upload-fab {
  position: absolute;
  right: 4px;
  bottom: 16px;
  z-index: 40;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: calc(100% - 8px);
  pointer-events: none;
}

.diary-photo-upload-fab__icon-btn {
  pointer-events: auto;
  display: flex;
  height: 48px;
  width: 48px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background-color: #8b7355;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(92, 74, 58, 0.28);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.diary-photo-upload-fab__icon-btn:hover {
  background-color: #7a5e4b;
}

.diary-photo-upload-fab__icon-btn:active {
  transform: scale(0.95);
}

.diary-photo-upload-fab__label {
  font-size: 13px;
  font-weight: 700;
  color: #5c4a3a;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  visibility: hidden;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.diary-photo-upload-fab__label--visible {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .diary-photo-upload-fab__label {
    transform: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }
}

/* 表單：吃藥／疫苗標籤丸 */
.diary-form-tag-pill {
  max-width: 100%;
}

.diary-form-tag-pill input[type="hidden"] {
  display: none;
}

/* 日曆選日後：毛孩選擇／日記登錄（柔和圓角、奶油底，對齊參考稿） */
.diary-flow-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.diary-flow-overlay {
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 32, 0.45);
  box-sizing: border-box;
}

.diary-flow-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: #fff9e8;
  box-shadow: 0 24px 48px rgba(45, 38, 32, 0.18), 0 0 0 1px rgba(92, 74, 58, 0.08);
  overflow: hidden;
  box-sizing: border-box;
}

.diary-flow-panel--pre-enter {
  opacity: 0;
  transform: translateY(10px);
}

.diary-flow-panel--pop {
  animation: diary-flow-panel-pop 0.24s ease-out;
  animation-fill-mode: both;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

@keyframes diary-flow-panel-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.diary-register-panel {
  max-height: min(92vh, 720px);
}

.diary-register-panel--pre-enter {
  opacity: 0;
  transform: translateY(12px);
}

.diary-register-panel--unroll {
  animation: diary-register-unroll 0.4s cubic-bezier(0.22, 0.9, 0.24, 1);
  animation-fill-mode: both;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

@keyframes diary-register-unroll {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.diary-flow-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.diary-flow-top-spacer {
  width: 44px;
  height: 44px;
}

.diary-flow-top-spacer-slot {
  box-sizing: border-box;
}

.diary-flow-submit-btn {
  min-width: 4rem;
  padding: 0 16px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(139, 115, 85, 0.16);
  color: #5c4a3a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.diary-flow-submit-btn:hover:not(:disabled) {
  background: rgba(139, 115, 85, 0.26);
}

.diary-flow-submit-btn:active:not(:disabled),
.diary-flow-submit-btn.is-tap-pressed:not(:disabled) {
  opacity: 1;
  transform: scale(0.96);
}

.diary-flow-submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.diary-flow-icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: rgba(139, 115, 85, 0.12);
  color: #6b5344;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.diary-flow-icon-btn:active,
.diary-flow-icon-btn.is-tap-pressed {
  opacity: 1;
  transform: scale(0.96);
}

.diary-flow-icon-btn:hover {
  background: rgba(139, 115, 85, 0.2);
}

.diary-flow-date-title {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #5c4a3a;
  line-height: 1.3;
  box-sizing: border-box;
}

.diary-flow-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px 22px;
  box-sizing: border-box;
}

.diary-flow-section-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(92, 74, 58, 0.75);
  box-sizing: border-box;
}

.diary-pet-picker-context {
  margin: 0 0 14px;
  box-sizing: border-box;
}

.diary-pet-picker-tile--calendar-filter {
  outline: 2px solid rgba(6, 182, 212, 0.85);
  outline-offset: 2px;
  box-shadow: 0 8px 22px rgba(6, 182, 212, 0.18);
}

.diary-pet-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  box-sizing: border-box;
}

@media (min-width: 380px) {
  .diary-pet-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.diary-pet-picker-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 108px;
  padding: 14px 10px;
  border: none;
  border-radius: 22px;
  background: #fffef6;
  box-shadow: 0 6px 16px rgba(45, 38, 32, 0.1);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.diary-pet-picker-tile:active {
  transform: scale(0.98);
}

.diary-pet-picker-tile:hover {
  box-shadow: 0 8px 22px rgba(45, 38, 32, 0.14);
}

.diary-pet-picker-tile__avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #5c4a3a;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}

.diary-pet-picker-tile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.diary-pet-picker-tile__name {
  font-size: 13px;
  font-weight: 800;
  color: #5c4a3a;
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.diary-flow-empty {
  margin: 8px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(92, 74, 58, 0.22);
  color: rgba(92, 74, 58, 0.85);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  box-sizing: border-box;
}

/* =========================================
   🌟 SUISA 專屬 Q 彈微互動動畫
   ========================================= */

/* 1. 頁面切換：改為柔和淡入，解除 fixed 元素被困住的 BUG */
@keyframes popIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.animate-pop-in {
  animation: popIn 0.3s ease-out forwards;
  transform: none !important;
}

/* 2. 底部導覽列：點擊擠壓回彈 */
@keyframes jellyBounce {
  0% { transform: scale(1); }
  40% { transform: scale(0.85); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.animate-jelly {
  animation: jellyBounce 0.4s ease-out;
}

/* =========================================
   通知中心（App_News）
   ========================================= */

.pet-sub-screen--app-news {
  background: #f3efe6;
}

.pet-sub-screen__header--app-news {
  background: rgba(255, 252, 246, 0.95);
  border-bottom-color: rgba(120, 90, 60, 0.12);
}

.pet-sub-screen__title--app-news {
  color: #4a3d32;
}

.pet-sub-screen__body--app-news {
  padding: 12px 14px 20px;
  background: #FFF9F6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-news-center-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  gap: 12px;
}

/* 上方約 3 則通知欄位高度，其餘可捲動 */
.app-news-center-upper {
  flex: 0 0 auto;
  max-height: 252px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid rgba(180, 150, 120, 0.28);
  background: #faf6ee;
}

.app-news-center-upper .app-news-list {
  margin: 0;
}

.app-news-center-upper .app-news-status {
  margin: 16px 12px;
}

.app-news-appointments {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px 8px;
  border-radius: 16px;
  border: 1px solid rgba(180, 150, 120, 0.35);
  background: #faf6ee;
  box-sizing: border-box;
}

.app-news-appointments.hidden {
  display: none;
}

.app-news-appointments__screen-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: #4a3d32;
  letter-spacing: 0.04em;
}

.app-news-appointments__day + .app-news-appointments__day {
  margin-top: 14px;
}

.app-news-appointments__day-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #4a3d32;
  line-height: 1.4;
}

.app-news-appointments__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-news-appointments__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid rgba(180, 150, 120, 0.28);
  box-shadow: 0 2px 8px rgba(74, 61, 50, 0.06);
  box-sizing: border-box;
}

.app-news-appointments__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(232, 147, 19, 0.14);
  color: #8b5a2b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-news-appointments__icon svg {
  width: 20px;
  height: 20px;
}

.app-news-appointments__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-news-appointments__pet {
  font-size: 11px;
  font-weight: 800;
  color: #6b4423;
  letter-spacing: 0.02em;
}

.app-news-appointments__line {
  font-size: 13px;
  font-weight: 700;
  color: #5c4a3a;
  line-height: 1.4;
  word-break: break-word;
}

.app-news-status {
  margin: 24px 8px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  color: #5c4a3a;
  line-height: 1.55;
}

.app-news-status--error {
  color: #9b3b2f;
}

.app-news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
}

.app-news-item {
  border-bottom: 1px solid rgba(180, 150, 120, 0.35);
}

.app-news-item:last-child {
  border-bottom: none;
}

.app-news-item__toggle {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.app-news-item__toggle:active .app-news-item__text {
  background: #f5f0e6;
}

.app-news-item__banner {
  flex: 0 0 auto;
  width: 76px;
  min-width: 76px;
  min-height: 76px;
  align-self: stretch;
  background: #e8dfd2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.app-news-item__banner--empty {
  background-color: #e8dfd2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23a89580' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 15l-4.5-4.5L9 18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 30px 30px;
}

.app-news-item__banner-img {
  width: 100%;
  height: 100%;
  min-height: 76px;
  object-fit: cover;
  display: block;
}

.app-news-item__text {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 12px 12px;
  background: #faf6ee;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  box-sizing: border-box;
}

.app-news-item__row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.app-news-item__date {
  font-size: 14px;
  font-weight: 800;
  color: #4a3d32;
  letter-spacing: 0.02em;
}

.app-news-item__type {
  font-size: 11px;
  font-weight: 750;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(139, 90, 43, 0.12);
  color: #6b4423;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-news-item__title {
  font-size: 13px;
  font-weight: 650;
  color: #5c4a3a;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.app-news-item__detail {
  padding: 0 14px 14px 14px;
  padding-left: calc(76px + 14px);
  background: #faf6ee;
  box-sizing: border-box;
}

@media (max-width: 360px) {
  .app-news-item__detail {
    padding-left: 14px;
  }
}

.app-news-item__content {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid rgba(180, 150, 120, 0.28);
  font-size: 13px;
  font-weight: 600;
  color: #4a3d32;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}

.app-news-item__content--muted {
  color: rgba(92, 74, 58, 0.65);
  font-weight: 600;
}

/* =========================================
   日記行事曆：強制固定格子比例，拉長顯示空間
   ========================================= */
   .diary-calendar-grid > * {
    /* 寬度 1 : 高度 1.5。數字越大格子越長，完美利用手機垂直空間 */
    aspect-ratio: 1 / 1.85; 
    height: auto !important; 
    min-height: 0 !important;
    max-height: none !important;
    /* 核心關鍵：強制隱藏超出的內容，確保邊界絕對不會被撐開變形 */
    overflow: hidden !important; 
  }
  /* =========================================
   🌟 日記細項：自動隱藏滾動條樣式 (含漸變)
   ========================================= */
.auto-hide-scroll {
  scrollbar-width: thin; 
  scrollbar-color: rgba(92, 74, 58, 0.25) transparent;
  /* Firefox 支援的漸變 */
  transition: scrollbar-color 0.8s ease-in-out; 
}

.auto-hide-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.auto-hide-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.auto-hide-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(92, 74, 58, 0.25);
  border-radius: 999px;
  /* Webkit 預留的漸變設定 */
  transition: background-color 0.8s ease-in-out; 
}

/* 隱藏狀態 */
.auto-hide-scroll.hide-scrollbar::-webkit-scrollbar-thumb {
  background-color: transparent !important;
}
.auto-hide-scroll.hide-scrollbar {
  scrollbar-color: transparent transparent !important;
}