html.message-temperature-active,
body.message-temperature-active {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #100b17;
  color: #f8eee2;
}

body.message-temperature-active .noise-layer,
body.message-temperature-active .bg-image-layer,
body.message-temperature-active #laxxm-support-widget { display: none !important; }
body.message-temperature-active #app { width: 100%; height: 100dvh; overflow: hidden; }

.info-modal--message-temperature .info-modal-desc { margin-bottom: 10px; }
.info-modal--message-temperature .info-modal-guide { margin: 0 0 18px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.55; }
body:has(.info-modal--message-temperature) #laxxm-support-widget { display: none !important; }
.info-modal-backdrop--message-temperature-closing { pointer-events: none; }

.mtr-screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: #100b17;
  color: #f8eee2;
  font-family: Pretendard Variable, Pretendard, system-ui, sans-serif;
}
.mtr-screen *, .mtr-screen *::before, .mtr-screen *::after { box-sizing: border-box; }
.mtr-screen button,
.info-modal--message-temperature button { position: relative; pointer-events: auto; touch-action: manipulation; }
.mtr-screen button > *,
.mtr-screen button::before,
.mtr-screen button::after,
.info-modal--message-temperature button > *,
.info-modal--message-temperature button::before,
.info-modal--message-temperature button::after,
[data-test-id="message-temperature"] > * { pointer-events: none; }
.mtr-screen button { font: inherit; }

.mtr-canvas {
  position: relative;
  width: min(100%, 430px);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #160f20;
}
.mtr-background { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; pointer-events: none; }
.mtr-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,5,16,.05) 0 34%, rgba(13,8,20,.12) 42%, rgba(13,8,20,.86) 100%); pointer-events: none; }
.mtr-header {
  position: absolute;
  z-index: 6;
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 10px;
}
.mtr-header button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; color: #f8ebdd; background: rgba(17,10,24,.66); }
.mtr-header div { display: grid; min-width: 0; gap: 2px; }
.mtr-header strong { max-width: 74vw; overflow: hidden; color: #f7ebdf; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mtr-header span { color: #b2a3af; font-size: 10px; letter-spacing: .08em; }

.mtr-history {
  position: absolute;
  z-index: 3;
  top: 36%;
  bottom: calc(190px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 18px;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent, #000 18px, #000 100%);
}
.mtr-history::-webkit-scrollbar { display: none; }
.mtr-message-row { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 5px; width: 100%; }
.mtr-message-row--other { justify-content: flex-start; }
.mtr-message-row--self { justify-content: flex-end; }
.mtr-bubble { flex: 0 0 auto; width: fit-content; max-width: 84%; padding: 11px 13px; color: #fff1df; box-shadow: 0 8px 20px rgba(0,0,0,.16); animation: mtr-bubble-in .18s ease-out both; }
.mtr-bubble p { margin: 0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.mtr-bubble--peer { border-radius: 7px 15px 15px 15px; background: #37304d; }
.mtr-bubble--user { border-radius: 15px 7px 15px 15px; background: #a95748; }
.mtr-message-time { flex: 0 0 auto; margin-bottom: 2px; color: rgba(219,207,213,.64); font-size: 10px; line-height: 1; white-space: nowrap; pointer-events: none; }
.mtr-day-separator { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 3px 0; color: rgba(216,202,211,.64); font-size: 10px; line-height: 1; pointer-events: none; }
.mtr-day-separator i { width: 24px; height: 1px; background: rgba(216,202,211,.18); }
.mtr-day-separator span { padding: 5px 8px; border: 1px solid rgba(216,202,211,.12); border-radius: 999px; background: rgba(34,25,42,.5); }
.mtr-live { position: fixed; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.mtr-new-message { position: absolute; z-index: 7; left: 50%; bottom: calc(196px + env(safe-area-inset-bottom)); min-height: 32px; padding: 6px 12px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #f8eee2; background: #4a3455; font-size: 10px; }
.mtr-new-message[hidden] { display: none; }
.mtr-typing { position: absolute; z-index: 5; left: 14px; bottom: calc(196px + env(safe-area-inset-bottom)); padding: 9px 12px; border-radius: 7px 15px 15px 15px; background: #37304d; pointer-events: none; }
.mtr-typing[hidden] { display: none; }
.mtr-typing i { display: inline-block; width: 4px; height: 4px; margin: 0 1px; border-radius: 50%; background: #d7c8d7; animation: mtr-typing 1s infinite; }
.mtr-typing i:nth-child(2) { animation-delay: .12s; }
.mtr-typing i:nth-child(3) { animation-delay: .24s; }

.mtr-replies {
  position: absolute;
  z-index: 6;
  inset: auto 0 0;
  min-height: calc(190px + env(safe-area-inset-bottom));
  padding: 13px max(13px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
  border-top: 1px solid rgba(255,255,255,.09);
  background: rgba(19,13,27,.96);
}
.mtr-replies button { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 8px; width: 100%; min-height: 46px; margin: 0 0 7px; padding: 8px 12px; border: 1px solid rgba(235,184,154,.22); border-radius: 10px; color: #f3e7db; background: #2c2134; text-align: left; }
.mtr-replies button:last-child { margin-bottom: 0; }
.mtr-replies button span { color: #d6927d; font-size: 10px; font-weight: 800; }
.mtr-replies button strong { font-size: 11px; font-weight: 600; line-height: 1.35; white-space: normal; }
.mtr-replies button span, .mtr-replies button strong { pointer-events: none; }
.mtr-replies button:disabled { opacity: .45; }
.mtr-replies button.is-selected { color: #fff3e4; border-color: #b66c5e; background: #7e443e; opacity: 1; }

.mtr-glow { position: absolute; inset: 0; pointer-events: none; }
.mtr-glow i { position: absolute; top: 8.5%; width: 31%; aspect-ratio: 1; border-radius: 50%; opacity: 0; filter: blur(14px); }
.mtr-glow i:first-child { left: 7%; background: radial-gradient(circle, rgba(255,197,117,.72), transparent 68%); }
.mtr-glow i:nth-child(2) { right: 7%; background: radial-gradient(circle, rgba(255,151,112,.72), transparent 68%); }
.mtr-glow span { position: absolute; top: 21%; left: 29%; width: 42%; height: 2px; opacity: 0; background: linear-gradient(90deg, transparent, #ffc778, transparent); transform: scaleX(.15); }
.mtr-canvas.is-peer-pulse .mtr-glow i:first-child,
.mtr-canvas.is-user-pulse .mtr-glow i:nth-child(2) { animation: mtr-glow .52s ease-out; }
.mtr-canvas.is-peer-pulse .mtr-glow span,
.mtr-canvas.is-user-pulse .mtr-glow span { animation: mtr-signal .52s ease-out; }

body.message-temperature-result-active { overflow: auto; }
body.message-temperature-result-active #app { height: auto; min-height: 100dvh; overflow: visible; }
.mtr-result { height: auto; min-height: 100dvh; overflow: visible; background: radial-gradient(circle at 50% 0, #2a1a30, #120d19 55%); }
.mtr-result-content { position: relative; width: min(520px, 100%); min-height: 100dvh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.mtr-result-close { position: absolute; z-index: 2; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; color: #f8eee2; background: rgba(18,12,25,.7); }
.mtr-result-art { width: min(72vw, 330px); aspect-ratio: 1122 / 1402; margin: 0 auto; overflow: hidden; border-radius: 18px; background: #1d1624; }
.mtr-result-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mtr-result header { margin: 18px 0 22px; text-align: center; }
.mtr-result header > p { margin: 0; color: #eda087; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.mtr-result h1 { margin: 8px 0 6px; font-size: clamp(28px, 7.4vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.mtr-result h1:focus { outline: 2px solid rgba(237,160,135,.72); outline-offset: 4px; border-radius: 4px; }
.mtr-result header strong { display: block; color: #e8aa91; font-size: 14px; line-height: 1.5; }
.mtr-result section { margin: 10px 0; padding: 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: #211827; }
.mtr-result section h2 { margin: 0 0 7px; color: #eda087; font-size: 12px; }
.mtr-result section p { margin: 0; color: #c9bdc6; font-size: 13px; line-height: 1.65; }
.mtr-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.mtr-result-actions button { min-height: 46px; padding: 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; color: #f4e8db; background: #302237; }
.mtr-result-actions button:last-child { grid-column: 1 / -1; }
.mtr-toast { min-height: 20px; margin: 10px 0 0; color: #d6a38e; text-align: center; opacity: 0; transition: opacity .16s; }
.mtr-toast.is-visible { opacity: 1; }

.mtr-legacy { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #2a1a30, #120d19 55%); text-align: center; }
.mtr-legacy section { width: min(420px, 100%); }
.mtr-legacy h1 { margin: 0 0 24px; font-size: clamp(28px, 7vw, 38px); }

@keyframes mtr-glow { 0%,100% { opacity: 0; transform: scale(.7); } 42% { opacity: 1; transform: scale(1); } }
@keyframes mtr-signal { 0%,100% { opacity: 0; transform: scaleX(.15); } 45% { opacity: .9; transform: scaleX(1); } }
@keyframes mtr-bubble-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mtr-typing { 0%,60%,100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

@media (max-height: 500px) {
  .info-modal--message-temperature { max-height: calc(100dvh - 12px); padding-bottom: 12px; }
  .info-modal--message-temperature .info-modal-hero { max-height: 96px; margin-bottom: 7px; }
  .info-modal--message-temperature .info-modal-hero img { height: 96px; }
  .info-modal--message-temperature .info-modal-cat { margin: 0 0 3px; }
  .info-modal--message-temperature .info-modal-title { margin-bottom: 4px; font-size: 18px; line-height: 1.2; }
  .info-modal--message-temperature .info-modal-desc,
  .info-modal--message-temperature .info-modal-guide { margin-bottom: 5px; font-size: 11px; line-height: 1.35; }
  .info-modal--message-temperature .info-modal-start { padding: 9px 14px; font-size: 13px; }
  .mtr-history { top: 30%; bottom: calc(150px + env(safe-area-inset-bottom)); padding-top: 8px; }
  .mtr-replies { min-height: calc(146px + env(safe-area-inset-bottom)); padding-top: 7px; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .mtr-replies button { min-height: 39px; margin-bottom: 5px; padding: 5px 10px; }
  .mtr-replies button strong { font-size: 10px; line-height: 1.25; }
  .mtr-typing, .mtr-new-message { bottom: calc(152px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .mtr-screen *, .mtr-screen *::before, .mtr-screen *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
