/* 甜筒 · ToTo 互动首页 — 视频作聊天背景 */
.toto-home {
  --th-ink: #333333;
  --th-muted: #666666;
  --th-chip: rgba(255, 255, 255, 0.92);
  --th-accent: #e87471;
  --th-soft: #f5f5f5;
  --th-bar: rgba(255, 255, 255, 0.88);
  --th-safe-top: env(safe-area-inset-top, 0px);
  --th-safe-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--th-ink);
  background-color: var(--bg, #FFFFFF);
  background-image:
    linear-gradient(var(--grid-line, #EEF2F6) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line, #EEF2F6) 1px, transparent 1px);
  background-size: var(--grid-size, 40px) var(--grid-size, 40px);
}

.toto-home > * { position: relative; z-index: 1; }

/* 顶部导航 */
.th-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(10px + var(--th-safe-top)) 10px 8px;
  background: var(--th-bar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 30;
}
.th-logo {
  font-family: 'Quicksand', 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--th-ink);
  white-space: nowrap;
  text-decoration: none;
}
.th-nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.th-nav-links::-webkit-scrollbar { display: none; }
.th-nav-btn {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--th-muted);
  background: transparent;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.th-nav-btn:active { background: rgba(0, 0, 0, 0.05); color: var(--th-ink); }
.th-gear {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--th-muted); background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0, 0, 0, 0.06); cursor: pointer; flex-shrink: 0;
}
.th-gear svg { width: 15px; height: 15px; }
.th-menu {
  position: absolute;
  top: calc(52px + var(--th-safe-top));
  right: 10px;
  min-width: 140px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 6px; z-index: 40; display: none;
}
.th-menu.open { display: block; }
.th-menu a, .th-menu button {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border: none; background: none;
  border-radius: 10px; font-size: 13px; color: var(--th-ink);
  text-decoration: none; cursor: pointer;
}
.th-menu a:hover, .th-menu button:hover { background: var(--th-soft); }

/* 主区默认（手机）：9:16 视频全屏聊天背景，优先保留底部 */
.th-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.th-bear-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* 底部留给情绪按钮+输入区，避免挡住视频下方 */
  bottom: var(--th-panel-h, 168px);
  z-index: 0;
  width: auto;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
}
/* 固定 9:16 画框：宽度 100% 铺满，高度按比例，保证左右完整 */
.th-bear-frame {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: transparent;
  /* 防止 iOS 把视频撑破画框 */
  max-width: 100%;
}
.th-bear-frame video,
.th-bear-frame img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0;
  /* 画框已是 9:16，contain = 完整铺满、不裁左右 */
  object-fit: contain;
  object-position: center center;
  display: block;
  background: transparent;
  /* iOS Safari：禁止默认全屏拉伸裁切 */
  -webkit-object-fit: contain;
}
.th-bear-frame img {
  z-index: 1;
  transition: opacity 0.35s;
}
.th-bear-frame video { z-index: 2; }
.th-bear-wrap.is-loading .th-bear-frame video { opacity: 0; }
.th-bear-wrap.is-ready .th-bear-frame video { opacity: 1; transition: opacity 0.3s; }

/* 底部渐变只盖在视频区域 */
.th-scrim {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--th-panel-h, 168px);
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.12) 0%, transparent 22%),
    linear-gradient(0deg, rgba(255,255,255,0.55) 0%, transparent 28%);
}

/* 聊天叠在视频上 */
.th-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.th-overlay > * { pointer-events: auto; }

.th-bubble {
  align-self: center;
  margin: 12px 16px 0;
  max-width: min(88vw, 420px);
  padding: 8px 14px;
  border-radius: 16px 16px 16px 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  line-height: 1.45;
  color: var(--th-ink);
  text-align: center;
  min-height: 2.4em;
  transition: opacity 0.35s;
  flex-shrink: 0;
}

.th-wardrobe-fab {
  align-self: center;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: none;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  flex-shrink: 0;
}

.th-chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 100%);
}
/* 空聊天区仍占位，把底部面板压下去，露出视频背景 */
.th-chat:empty {
  display: flex;
}
.th-msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.th-msg.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.88);
  border-bottom-right-radius: 5px;
}
.th-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-bottom-left-radius: 5px;
}
.th-msg.typing { opacity: 0.75; font-style: italic; }

.th-panel {
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-top: 4px;
}

.th-voice-status {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--th-muted);
}
.th-voice-status.on { display: flex; }
.th-voice-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--th-accent);
  animation: th-pulse 1.2s ease-in-out infinite;
}
@keyframes th-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.th-emotions {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 12px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.th-emotions::-webkit-scrollbar { display: none; }
.th-emotion {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--th-chip);
  color: var(--th-ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  -webkit-tap-highlight-color: transparent;
}
.th-emotion:active { transform: scale(0.96); }
.th-emotion.active {
  background: #ffe8e4;
  border-color: rgba(232, 116, 113, 0.35);
  color: #b84f4c;
}

.th-emoji-panel {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 12px 0;
}
.th-emoji-panel.open { display: flex; }
.th-emoji-panel button {
  width: 34px; height: 34px; border: none; background: transparent;
  font-size: 20px; cursor: pointer; border-radius: 8px;
}

.th-chat-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px 2px;
  gap: 8px;
}
.th-voice-pick,
.th-clear-chat {
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--th-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.th-voice-pick:active,
.th-clear-chat:active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--th-ink);
}
.th-voice-menu {
  position: fixed;
  z-index: 80;
  min-width: 168px;
  max-width: min(240px, calc(100vw - 24px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 6px;
}
.th-voice-opt-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 10px;
}
.th-voice-opt-row.is-active {
  background: rgba(107, 103, 179, 0.08);
}
.th-voice-opt {
  flex: 1;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  font-size: 13px;
  color: var(--th-ink);
  cursor: pointer;
}
.th-voice-preview-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--th-muted);
  font-size: 12px;
  cursor: pointer;
}
.th-voice-preview-btn.is-playing,
.th-voice-preview-btn:active {
  color: var(--th-ink);
  background: rgba(0, 0, 0, 0.05);
}

.th-composer {
  flex-shrink: 0;
  padding: 6px 10px calc(10px + var(--th-safe-bottom));
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.th-input-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  padding: 5px 6px 5px 12px;
  min-height: 42px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.th-input {
  flex: 1;
  border: none; outline: none; resize: none;
  font-size: 15px; line-height: 1.4; max-height: 80px;
  background: transparent; color: var(--th-ink); font-family: inherit;
  padding: 6px 0;
}
.th-input::placeholder { color: #b0a098; }

.th-icon-btn {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: transparent; color: var(--th-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.th-icon-btn svg { width: 18px; height: 18px; }
.th-icon-btn.active { color: var(--th-accent); background: #ffe8e4; }

.th-send {
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: var(--th-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(232, 116, 113, 0.35);
}
.th-send:disabled { opacity: 0.45; }
.th-send svg { width: 17px; height: 17px; }

/* 功能预告弹层（换装 / 小熊的家） */
.th-preview {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(40, 28, 22, 0.55);
  display: none; align-items: center; justify-content: center; padding: 20px;
  padding-top: calc(20px + var(--th-safe-top));
  padding-bottom: calc(20px + var(--th-safe-bottom));
}
.th-preview.open { display: flex; }
.th-preview-card {
  width: min(88vw, 360px);
  max-height: 88dvh;
  background: #111;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
}
.th-preview-media {
  position: relative; width: 100%;
  aspect-ratio: 9 / 16;
  background: #efe4d8;
}
.th-preview-media video,
.th-preview-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.th-preview-alert {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(40, 28, 22, 0.38);
}
.th-preview-alert.open { display: flex; }
.th-preview-alert-card {
  width: min(92%, 300px);
  max-height: min(86%, 520px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  -webkit-overflow-scrolling: touch;
}
.th-preview-alert-simple p {
  margin: 0;
  padding: 24px 20px 18px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #3d2c24;
  line-height: 1.5;
}
.th-preview-alert-copy {
  padding: 20px 18px 8px;
  text-align: center;
}
.th-preview-alert-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #3d2c24;
  line-height: 1.45;
}
.th-preview-alert-text {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  line-height: 1.55;
}
.th-preview-wish {
  padding: 4px 14px 12px;
}
.th-preview-wish-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  resize: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: #3d2c24;
  background: #faf7f4;
  outline: none;
}
.th-preview-wish-input:focus {
  border-color: rgba(232, 116, 113, 0.55);
  background: #fff;
}
.th-preview-wish-input::placeholder { color: #b0a098; }
.th-preview-wish-submit {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, #f0a35a, #e87471);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(232, 116, 113, 0.28);
}
.th-preview-wish-submit:active { transform: scale(0.98); }
.th-preview-alert-ok {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: #e87471;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.th-preview-alert-card.is-home .th-preview-alert-ok {
  color: #888;
  font-weight: 600;
  font-size: 14px;
}
.th-preview-alert-ok:active { background: #faf7f4; }
.th-preview-x {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.toto-home-active #pet-root,
body.toto-home-active #bottom-nav {
  display: none !important;
}
body.toto-home-active {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
}
html:has(body.toto-home-active) {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
body.toto-home-active #app,
body.toto-home-active .app-main,
body.toto-home-active #page-container {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  background: transparent;
}
body.toto-home-active #page-container {
  display: flex;
  flex-direction: column;
}
body.toto-home-active #page-container > .toto-home {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

@media (max-width: 959px) {
  body.toto-home-active #app { flex-direction: column; }
  body.toto-home-active #app-sidebar {
    display: none !important;
  }
}

/* 电脑端：还原「上方 9:16 视频 + 下方聊天」，不做全屏视频背景 */
@media (min-width: 960px) {
  body.toto-home-active #app {
    flex-direction: row;
    align-items: stretch;
  }
  body.toto-home-active #app-sidebar:not(.hidden) {
    display: flex !important;
  }
  body.toto-home-active .app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: stretch;
    background: transparent;
  }
  body.toto-home-active #page-container > .toto-home {
    width: 100%;
    max-width: none;
    background-color: transparent;
    background-image: none;
  }
  body.toto-home-active .th-nav-links {
    display: none;
  }
  body.toto-home-active .th-nav {
    justify-content: space-between;
    padding: 12px 20px 8px;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .th-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .th-bear-wrap {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    inset: auto;
    z-index: 0;
    flex: 1 1 0;
    min-height: 160px;
    width: auto;
    height: auto;
    max-height: min(52dvh, 100%);
    aspect-ratio: 9 / 16;
    max-width: min(360px, 42vh);
    align-self: center;
    margin: 8px auto 0;
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
    display: block;
  }
  .th-bear-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
  .th-bear-frame video,
  .th-bear-frame img {
    object-fit: contain;
    object-position: center center;
  }

  .th-scrim {
    display: none;
  }

  .th-overlay {
    position: relative;
    inset: auto;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }

  .th-wardrobe-fab {
    display: none;
  }

  .th-bubble {
    margin: 10px 16px 6px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .th-chat {
    flex: 0 1 auto;
    max-height: 140px;
    min-height: 0;
    padding: 4px 14px 6px;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .th-chat:empty {
    display: none;
  }

  .th-msg {
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .th-msg.user {
    background: #f5f5f5;
  }
  .th-msg.bot {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
  }

  .th-panel {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }

  .th-composer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }
  .th-input-wrap {
    box-shadow: none;
  }
}

/* ── 用户反馈弹窗（齿轮入口）─────────────────────────────────── */
.th-feedback-modal[hidden],
.th-feedback-success[hidden] { display: none !important; }

.th-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(40, 28, 22, 0.48);
}
@media (min-width: 640px) {
  .th-feedback-modal {
    align-items: center;
    padding: 24px;
  }
}

.th-feedback-sheet {
  position: relative;
  width: min(100%, 440px);
  max-height: min(92dvh, 720px);
  overflow: auto;
  background: #fffdfb;
  border-radius: 22px 22px 0 0;
  padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  .th-feedback-sheet {
    border-radius: 22px;
    padding: 26px 22px 22px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  }
}

.th-feedback-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: #888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.th-feedback-title {
  margin: 4px 28px 18px 0;
  font-size: 17px;
  font-weight: 700;
  color: #3d2c24;
  line-height: 1.45;
}

.th-fb-mod { margin-bottom: 18px; }
.th-fb-mod-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #8a6e60;
  letter-spacing: 0.02em;
}

.th-fb-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 8px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.45;
  color: #3d2c24;
}
.th-fb-option:has(input:checked) {
  border-color: rgba(232, 116, 113, 0.55);
  background: #fff6f4;
}
.th-fb-option input {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #e87471;
}
.th-fb-option span { flex: 1; }

.th-fb-other {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  color: #3d2c24;
  background: #faf7f4;
  outline: none;
}
.th-fb-other:focus {
  border-color: rgba(232, 116, 113, 0.55);
  background: #fff;
}
.th-fb-other[hidden] { display: none !important; }

.th-fb-message {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  resize: vertical;
  min-height: 96px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #3d2c24;
  background: #faf7f4;
  outline: none;
}
.th-fb-message:focus {
  border-color: rgba(232, 116, 113, 0.55);
  background: #fff;
}
.th-fb-message::placeholder { color: #b0a098; }

.th-fb-submit {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 13px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, #f0a35a, #e87471);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(232, 116, 113, 0.28);
}
.th-fb-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.th-fb-submit:not(:disabled):active { transform: scale(0.98); }

.th-fb-error {
  margin: 10px 0 0;
  font-size: 12px;
  color: #d4534c;
  text-align: center;
  line-height: 1.4;
}

.th-feedback-success {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(40, 28, 22, 0.48);
}
.th-feedback-success-card {
  width: min(92%, 320px);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}
.th-feedback-success-text {
  margin: 0;
  padding: 26px 20px 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #3d2c24;
  line-height: 1.6;
}
.th-feedback-success-ok {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  color: #e87471;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.th-feedback-success-ok:active { background: #faf7f4; }
