:root {
  --bg: #f7f4ee;
  --bg-soft: #fbfaf7;
  --ink: #2f3133;
  --muted: #7b7f82;
  --line: #ded8cf;
  --warm: #c9a66b;
  --warm-soft: #efe2cc;
  --blue-soft: #dbe6e8;
  --shadow: 0 22px 70px rgba(65, 58, 48, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.85), transparent 26rem),
    linear-gradient(180deg, #f6f1e8 0%, #f7f7f5 48%, #eef3f2 100%);
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(920px, calc(100% - 36px));
  min-height: calc(100vh - 96px);
  margin: 0 auto;
  padding: 54px 0 28px;
}

.site-header {
  display: flex;
  justify-content: center;
  text-align: center;
}

.music-button {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 20;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 14px 7px 10px;
  color: #2f3133;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  clip-path: inset(0 round 12px);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 24px rgba(65, 58, 48, 0.11), inset 0 0 0 1px rgba(92, 86, 77, 0.06);
  backdrop-filter: blur(18px) saturate(1.25);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.music-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(65, 58, 48, 0.14), inset 0 0 0 1px rgba(92, 86, 77, 0.06);
}

.music-button:hover .vinyl-disc {
  transform: rotate(10deg);
}

.vinyl-disc {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  margin: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, #f4ead8 0 10%, #1d1e1f 11% 17%, transparent 18%),
    repeating-radial-gradient(circle, #191a1b 0 2px, #2d2f31 3px 4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 180ms ease;
}

.vinyl-disc::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(244, 234, 216, 0.28);
  border-radius: 50%;
}

.music-button-text {
  color: #4d5152;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.1;
  text-transform: lowercase;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.8rem);
  font-weight: 500;
  line-height: 1.05;
}

.brand-subtitle {
  margin: 10px 0 0;
  color: #74716c;
  font-size: clamp(0.9rem, 2vw, 1.08rem);
  line-height: 1.4;
}

.intro {
  margin: 28px auto 30px;
  color: #5d6062;
  font-size: clamp(1rem, 2.4vw, 1.16rem);
  line-height: 1.85;
  text-align: center;
}

.intro p {
  margin: 0;
}

.station {
  position: relative;
  width: min(680px, 100%);
  margin: 0 auto;
}

.paper-wrap {
  position: relative;
  min-height: 270px;
  border: 1px solid rgba(222, 216, 207, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(201, 166, 107, 0.12) 1px, transparent 1px) 38px 0 / 1px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0, transparent 34px, rgba(160, 154, 145, 0.12) 35px),
    rgba(255, 254, 250, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: center;
}

.paper-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent 52%);
}

.emotion-input {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 270px;
  padding: 30px 32px 30px 54px;
  resize: vertical;
  color: #383838;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1.02rem;
  line-height: 1.8;
}

.emotion-input::placeholder {
  color: #9b958d;
}

.emotion-input:disabled {
  color: #555;
}

.privacy-note,
.notice {
  margin: 12px 4px 0;
  min-height: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.notice {
  color: #9a6844;
}

.comfort-console {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(222, 216, 207, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 16px 42px rgba(65, 58, 48, 0.07);
}

.console-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 16px;
}

.action-console-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(222, 216, 207, 0.72);
}

.console-label {
  margin: 0;
  color: #74716c;
  font-size: 0.9rem;
  text-align: left;
}

.control-group,
.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.mood-button,
.action-button,
.again-button,
.advice-button {
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.mood-button {
  min-height: 36px;
  padding: 0 14px;
  color: #5b5e60;
  border: 1px solid rgba(190, 184, 174, 0.85);
  background: rgba(255, 255, 255, 0.54);
  font-size: 0.94rem;
}

.mood-button:hover,
.mood-button.is-selected {
  color: #423a30;
  border-color: rgba(201, 166, 107, 0.82);
  background: var(--warm-soft);
  box-shadow: 0 8px 24px rgba(133, 106, 63, 0.12);
}

.action-button {
  flex: 1 1 0;
  min-width: 130px;
  min-height: 48px;
  padding: 0 22px;
  color: #334244;
  border: 1px solid rgba(118, 146, 149, 0.5);
  background: rgba(219, 230, 232, 0.86);
  font-weight: 500;
}

.action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(94, 129, 133, 0.68);
  background: rgba(203, 222, 224, 0.98);
  box-shadow: 0 12px 28px rgba(67, 95, 99, 0.12);
}

.action-button:disabled,
.mood-button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.result-panel {
  margin: 14px auto 0;
  text-align: center;
  animation: resultIn 600ms ease both;
}

.result-panel p {
  margin: 0 0 12px;
  color: #4b5253;
  font-size: clamp(1.05rem, 2.4vw, 1.22rem);
  line-height: 1.75;
}

.result-panel .result-wish {
  margin-bottom: 8px;
  color: #5f6768;
  font-size: 1rem;
}

.result-panel .use-less-note {
  width: min(460px, 100%);
  margin: 0 auto 16px;
  color: #8a8177;
  font-size: 0.9rem;
  line-height: 1.7;
}

.result-panel .advice-text {
  width: min(520px, 100%);
  margin: 0 auto 14px;
  padding: 12px 14px;
  color: #465052;
  border: 1px solid rgba(130, 153, 156, 0.28);
  border-radius: var(--radius);
  background: rgba(219, 230, 232, 0.38);
  font-size: 0.96rem;
  line-height: 1.75;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.again-button,
.advice-button,
.chat-open-button {
  min-height: 42px;
  padding: 0 20px;
  color: #44382a;
  border: 1px solid rgba(201, 166, 107, 0.7);
  background: rgba(255, 250, 239, 0.84);
}

.chat-open-button {
  color: #334244;
  border-color: rgba(130, 153, 156, 0.42);
  background: rgba(238, 247, 246, 0.86);
}

.again-button:hover,
.advice-button:hover,
.chat-open-button:hover {
  transform: translateY(-1px);
}

.again-button:hover,
.advice-button:hover {
  background: #fff7e7;
}

.chat-open-button:hover {
  background: #eef9f7;
}

.advice-button:disabled {
  cursor: not-allowed;
  color: #8d8580;
  background: rgba(238, 235, 229, 0.82);
  border-color: rgba(196, 189, 179, 0.72);
  transform: none;
}

.site-footer {
  width: min(980px, calc(100% - 36px));
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 0 auto;
  padding: 18px 0 24px;
  color: #86817a;
  font-size: 0.84rem;
}

.footer-center {
  text-align: center;
}

.footer-center p {
  margin: 0;
  line-height: 1.7;
}

.footer-center a {
  color: #6e7779;
  text-decoration: none;
}

.footer-center a:hover {
  color: #3f4749;
  text-decoration: underline;
}

.policy-shell {
  width: min(820px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.policy-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.policy-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  color: #606467;
  text-decoration: none;
  border: 1px solid rgba(190, 184, 174, 0.66);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  transition: transform 160ms ease, background 160ms ease;
}

.policy-back:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.82);
}

.policy-card {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(222, 216, 207, 0.86);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.82);
  box-shadow: var(--shadow);
}

.policy-card h1 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.policy-lead {
  margin: 0 0 10px;
  color: #596062;
  font-size: 1.02rem;
  line-height: 1.9;
}

.policy-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(222, 216, 207, 0.72);
}

.policy-section h2 {
  margin: 0 0 12px;
  color: #3f4244;
  font-size: 1.05rem;
  font-weight: 600;
}

.policy-section p {
  margin: 0 0 10px;
  color: #5d6264;
  line-height: 1.9;
}

.policy-ending {
  margin-top: 34px;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(219, 230, 232, 0.42);
  color: #485153;
  text-align: center;
}

.policy-ending p {
  margin: 0;
  line-height: 1.9;
}

.policy-ending p + p {
  margin-top: 8px;
}

.feedback-button {
  justify-self: end;
  min-height: 42px;
  padding: 0 18px;
  color: #3d4546;
  border: 1px solid rgba(130, 153, 156, 0.45);
  border-radius: 999px;
  background: rgba(250, 251, 249, 0.86);
  box-shadow: 0 12px 34px rgba(67, 95, 99, 0.14);
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.privacy-link {
  justify-self: start;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  color: #6f6b65;
  text-decoration: none;
  border: 1px solid rgba(190, 184, 174, 0.56);
  border-radius: 999px;
  background: rgba(250, 251, 249, 0.72);
  box-shadow: 0 10px 26px rgba(65, 58, 48, 0.08);
  backdrop-filter: blur(10px);
  font-size: 0.86rem;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.privacy-link:hover {
  transform: translateY(-1px);
  color: #44413d;
  background: rgba(255, 255, 255, 0.9);
}

.feedback-button:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(67, 95, 99, 0.18);
}

.feedback-dialog,
.music-dialog,
.chat-dialog {
  width: min(440px, calc(100% - 36px));
  padding: 0;
  color: var(--ink);
  border: 1px solid rgba(222, 216, 207, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.98);
  box-shadow: 0 26px 90px rgba(48, 44, 38, 0.22);
}

.chat-dialog {
  width: min(520px, calc(100% - 28px));
}

.feedback-dialog::backdrop,
.music-dialog::backdrop,
.chat-dialog::backdrop {
  background: rgba(54, 52, 49, 0.24);
  backdrop-filter: blur(3px);
}

.feedback-form,
.music-panel {
  padding: 24px;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(260px, 46vh) auto;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(247, 249, 247, 0.98));
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(222, 216, 207, 0.76);
}

.chat-kicker {
  margin: 0 0 3px;
  color: #8a8177;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-header h2 {
  margin: 0;
  color: #343638;
  font-size: 1.06rem;
  font-weight: 500;
}

.chat-close {
  min-height: 34px;
  padding: 0 13px;
  color: #596062;
  border: 1px solid rgba(190, 184, 174, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(239, 242, 239, 0.7), rgba(247, 244, 238, 0.52)),
    rgba(247, 244, 238, 0.62);
}

.chat-message {
  max-width: min(78%, 360px);
  margin: 0;
  padding: 10px 13px;
  border: 1px solid rgba(222, 216, 207, 0.72);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(65, 58, 48, 0.06);
  font-size: 0.95rem;
  line-height: 1.65;
  word-break: break-word;
}

.chat-message.is-assistant {
  align-self: flex-start;
  border-top-left-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
}

.chat-message.is-user {
  align-self: flex-end;
  color: #263638;
  border-color: rgba(142, 178, 164, 0.42);
  border-top-right-radius: 5px;
  background: rgba(216, 237, 226, 0.94);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(222, 216, 207, 0.76);
  background: rgba(255, 254, 250, 0.94);
}

.chat-input {
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid rgba(190, 184, 174, 0.82);
  border-radius: 14px;
  outline: none;
  background: rgba(247, 244, 238, 0.62);
  line-height: 1.55;
}

.chat-input:focus {
  border-color: rgba(130, 153, 156, 0.74);
  box-shadow: 0 0 0 3px rgba(130, 153, 156, 0.15);
}

.chat-send {
  align-self: end;
  min-height: 42px;
  padding: 0 18px;
  color: #2f3f41;
  border: 1px solid rgba(130, 153, 156, 0.46);
  border-radius: 999px;
  background: rgba(238, 247, 246, 0.9);
}

.chat-send:disabled {
  cursor: not-allowed;
  color: #8d8580;
  background: rgba(238, 235, 229, 0.82);
}

.feedback-form h2,
.music-panel h2 {
  margin: 0 0 16px;
  color: #343638;
  font-size: 1.14rem;
  font-weight: 500;
  line-height: 1.5;
}

.music-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0 18px;
}

.music-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 116px;
  padding: 16px 10px 14px;
  color: #384244;
  text-decoration: none;
  border: 1px solid rgba(190, 184, 174, 0.82);
  border-radius: var(--radius);
  background: rgba(247, 244, 238, 0.52);
  box-shadow: 0 10px 26px rgba(65, 58, 48, 0.06);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.music-links a:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 166, 107, 0.76);
  background: rgba(255, 247, 231, 0.82);
  box-shadow: 0 14px 30px rgba(65, 58, 48, 0.1);
}

.platform-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(190, 184, 174, 0.38), 0 8px 18px rgba(65, 58, 48, 0.08);
}

.platform-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.feedback-input {
  display: block;
  width: 100%;
  min-height: 138px;
  padding: 14px 15px;
  resize: vertical;
  color: #383838;
  border: 1px solid rgba(190, 184, 174, 0.82);
  border-radius: var(--radius);
  outline: none;
  background: rgba(247, 244, 238, 0.62);
  line-height: 1.7;
}

.feedback-input:focus {
  border-color: rgba(201, 166, 107, 0.88);
  box-shadow: 0 0 0 3px rgba(201, 166, 107, 0.16);
}

.feedback-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.feedback-note {
  min-height: 22px;
  margin: 10px 0 14px;
  color: #8d6941;
  font-size: 0.88rem;
}

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

.dialog-submit,
.dialog-cancel {
  min-height: 38px;
  padding: 0 17px;
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.dialog-submit {
  color: #44382a;
  border: 1px solid rgba(201, 166, 107, 0.72);
  background: rgba(255, 247, 231, 0.94);
}

.dialog-cancel {
  color: #596062;
  border: 1px solid rgba(190, 184, 174, 0.82);
  background: rgba(255, 255, 255, 0.7);
}

.dialog-submit:hover,
.dialog-cancel:hover {
  transform: translateY(-1px);
}

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

.is-processing .control-group,
.is-processing .action-row,
.is-processing .privacy-note,
.is-processing .notice {
  pointer-events: none;
  opacity: 0.4;
}

.is-processing .comfort-console {
  display: none;
}

.paper-wrap.is-shredding {
  overflow: visible;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  animation: shredContainer 2500ms ease forwards;
}

.paper-wrap.is-shredding::before {
  opacity: 0;
}

.paper-wrap.is-shredding .emotion-input {
  opacity: 0;
  transition: opacity 120ms ease;
}

.shred-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.crack-lines {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  animation: crackReveal 1080ms ease forwards;
}

.crack-lines polyline,
.crack-lines path {
  fill: none;
  stroke: rgba(123, 105, 82, 0.42);
  stroke-width: 0.72;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.paper-piece {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #555;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(201, 166, 107, 0.12) 1px, transparent 1px) 38px 0 / 1px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0, transparent 34px, rgba(160, 154, 145, 0.11) 35px),
    rgba(255, 254, 250, 0.96);
  box-shadow: none;
  clip-path: polygon(var(--clip));
  transform-origin: center;
  animation: pieceFall 2200ms cubic-bezier(0.28, 0.68, 0.26, 1) forwards;
  animation-delay: var(--delay);
}

.piece-text {
  position: absolute;
  inset: 0;
  padding: 30px 32px 30px 54px;
  font-size: 1.02rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.paper-wrap.is-floating {
  animation: floatAway 2200ms cubic-bezier(0.2, 0.7, 0.26, 1) forwards;
}

.paper-wrap.is-fading {
  animation: breatheFade 3100ms ease-in-out forwards;
}

@keyframes shredContainer {
  0%, 18% {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
  5% {
    transform: translateX(-3px) rotate(-0.25deg);
  }
  10% {
    transform: translateX(3px) rotate(0.25deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

@keyframes crackReveal {
  0% {
    opacity: 0;
    transform: scale(0.996);
  }
  38%, 76% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.004);
  }
}

@keyframes pieceFall {
  0%, 30% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
    filter: drop-shadow(0 0 0 rgba(65, 58, 48, 0));
  }
  44% {
    opacity: 1;
    transform: translate3d(var(--drift-start), -10px, 0) rotate(var(--rotate-small));
    filter: drop-shadow(0 10px 18px rgba(65, 58, 48, 0.08));
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-end), var(--fall), 0) rotate(var(--rotate));
    filter: drop-shadow(0 16px 22px rgba(65, 58, 48, 0.04)) blur(0.8px);
  }
}

@keyframes floatAway {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
  }
  38% {
    transform: translate(24px, -28px) rotate(2deg) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: translate(145px, -190px) rotate(9deg) scale(0.76);
    filter: blur(1.5px);
  }
}

@keyframes breatheFade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  20% {
    transform: scale(1.025);
  }
  40% {
    transform: scale(0.985);
  }
  60% {
    opacity: 0.82;
    transform: scale(1.018);
  }
  100% {
    opacity: 0;
    transform: scale(0.98);
    filter: blur(1.2px);
  }
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 920px);
    min-height: auto;
    padding-top: 34px;
  }

  .music-button {
    top: 14px;
    right: 14px;
    min-height: 38px;
    padding: 6px 11px 6px 8px;
    border-radius: 11px;
    clip-path: inset(0 round 11px);
  }

  .vinyl-disc {
    width: 23px;
    height: 23px;
  }

  .music-button-text {
    font-size: 0.8rem;
  }

  .paper-wrap,
  .emotion-input {
    min-height: 245px;
  }

  .emotion-input {
    padding: 26px 20px 26px 42px;
    font-size: 0.98rem;
  }

  .piece-text {
    padding: 26px 20px 26px 42px;
    font-size: 0.98rem;
  }

  .comfort-console {
    padding: 14px 12px;
  }

  .console-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .console-label {
    text-align: center;
  }

  .control-group,
  .action-row {
    justify-content: center;
  }

  .mood-button {
    flex: 1 1 calc(50% - 10px);
  }

  .action-button {
    flex: 1 1 100%;
  }

  .site-footer {
    width: min(100% - 24px, 980px);
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    padding-bottom: 22px;
    text-align: center;
  }

  .feedback-button {
    justify-self: center;
    min-height: 40px;
    padding: 0 15px;
    font-size: 0.9rem;
  }

  .privacy-link {
    justify-self: center;
    min-height: 36px;
    max-width: 100%;
    padding: 0 12px;
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .feedback-form,
  .music-panel {
    padding: 20px;
  }

  .chat-panel {
    grid-template-rows: auto minmax(280px, 54vh) auto;
  }

  .chat-header {
    padding: 16px;
  }

  .chat-messages {
    padding: 14px 12px 16px;
  }

  .chat-message {
    max-width: 84%;
    font-size: 0.92rem;
  }

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

  .chat-send {
    width: 100%;
  }

  .music-links {
    grid-template-columns: 1fr;
  }

  .music-links a {
    min-height: 76px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 14px;
  }

  .platform-icon {
    width: 40px;
    height: 40px;
    margin: 0;
  }

  .platform-icon img {
    width: 24px;
    height: 24px;
  }
}

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