:root {
  --warm-white: #FFFCF8;
  --brand-orange: #FF7A2F;
  --brand-orange-dark: #F36A20;
  --soft-orange: #FFF0E5;
  --peach: #FFF4E8;
  --peach-deep: #FCE8D5;
  --sage: #DDE8D4;
  --sage-deep: #9EB58F;
  --ink: #27231F;
  --muted: #716A63;
  --weak: #A49C94;
  --line: #F0E4D8;
  --white: #FFFFFF;
  --bear: #B9825D;
  --bear-light: #D6A37D;
  --shadow: 0 8px 30px rgba(76, 50, 30, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--warm-white);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--warm-white); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--warm-white); }
button { font: inherit; }
button:focus-visible, [role="button"]:focus-visible { outline: 3px solid rgba(255, 122, 47, .35); outline-offset: 3px; }

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--warm-white);
  box-shadow: 0 0 0 1px rgba(240, 228, 216, .7), 0 18px 60px rgba(76, 50, 30, .08);
}

.page {
  position: relative;
  min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar, .brand, .top-actions, .progress-row, .bottom-row, .match-line, .event-line, .avatar-row, .setting-row { display: flex; align-items: center; }
.topbar, .progress-row, .bottom-row, .match-line, .setting-row { justify-content: space-between; }
.brand { gap: 8px; min-width: 0; }
.brand-bear { width: 38px; height: 38px; flex: 0 0 auto; }
.brand-copy { display: grid; gap: 1px; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.05em; }
.brand-sub { color: var(--muted); font-size: 10px; }
.city-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.top-actions { gap: 7px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--white); cursor: pointer; font-size: 14px; }
.icon-button:hover { color: var(--brand-orange); border-color: var(--brand-orange); }

.progress-row { gap: 12px; margin: 27px 0 31px; }
.progress-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.progress-track { width: 136px; height: 4px; overflow: hidden; border-radius: 999px; background: var(--peach-deep); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand-orange); transition: width 260ms ease; }

.content { flex: 1; }
.hero { display: flex; flex: 1; flex-direction: column; justify-content: center; padding: 20px 0 24px; }
.eyebrow { margin: 0 0 13px; color: var(--brand-orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 330px; margin-bottom: 13px; font-size: clamp(31px, 8.4vw, 39px); line-height: 1.13; letter-spacing: -.07em; }
h2 { max-width: 340px; margin-bottom: 10px; font-size: clamp(25px, 7vw, 31px); line-height: 1.15; letter-spacing: -.065em; }
h3 { margin-bottom: 6px; font-size: 18px; line-height: 1.3; letter-spacing: -.045em; }
.subtitle, .helper { max-width: 315px; margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.helper { margin-bottom: 24px; }
.bubble-note { max-width: 216px; margin: 0 auto 17px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); font-size: 12px; line-height: 1.55; }
.bubble-note::after { content: ""; display: block; position: absolute; }
.welcome-points { display: grid; gap: 9px; margin: 22px 0; }
.welcome-point { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.point-check { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; color: var(--brand-orange-dark); background: var(--soft-orange); font-size: 12px; font-weight: 900; }

.bottom-bar { margin-top: auto; padding-top: 20px; background: linear-gradient(to top, var(--warm-white) 72%, rgba(255,252,248,0)); }
.button { min-height: 52px; padding: 14px 18px; border: 1px solid transparent; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 800; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: scale(.98); }
.button.primary { width: 100%; color: var(--white); background: var(--brand-orange); box-shadow: 0 8px 18px rgba(255, 122, 47, .16); }
.button.primary:hover { background: var(--brand-orange-dark); }
.button.secondary { color: var(--muted); border-color: var(--line); background: var(--white); }
.button.ghost { min-height: auto; padding: 8px 0; color: var(--brand-orange-dark); background: transparent; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }
.footnote { margin: 12px 0 0; color: var(--weak); font-size: 11px; line-height: 1.55; text-align: center; }
.bottom-row { gap: 10px; }
.bottom-row .button { flex: 1; }

.bear-mascot { display: inline-block; color: var(--bear); }
.bear-tiny { width: 36px; height: 36px; }
.bear-sm { width: 48px; height: 48px; }
.bear-md { width: 92px; height: 92px; }
.bear-lg { width: 148px; height: 148px; }
.bear-mascot svg { width: 100%; height: 100%; overflow: visible; }
.bear-mascot .scarf { fill: var(--brand-orange); }
.bear-mascot .cheek { fill: #EEA27C; opacity: .75; }
.bear-peek { position: absolute; right: -8px; bottom: -10px; width: 77px; height: 77px; pointer-events: none; }
.bear-peek .bear-mascot { width: 77px; height: 77px; }
.bear-hint { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: var(--shadow); }
.bear-hint .bear-mascot { width: 39px; height: 39px; flex: 0 0 auto; }
.bear-hint p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.question-head { position: relative; }
.question-head .bear-peek { bottom: -4px; }
.bubble-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; min-height: 185px; padding: 5px 0 12px; }
.bubble-tag { position: relative; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--white); cursor: pointer; box-shadow: 0 4px 14px rgba(76, 50, 30, .035); font-size: 13px; line-height: 1.3; transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; animation: bubble-float 4.6s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.bubble-tag:nth-child(3n) { animation-duration: 5.2s; }
.bubble-tag:nth-child(4n) { animation-duration: 4.2s; }
.bubble-tag.tone-cream { background: var(--peach); }
.bubble-tag.tone-sage { background: var(--sage); }
.bubble-tag.tone-apricot { background: var(--soft-orange); }
.bubble-tag:hover { border-color: var(--brand-orange); box-shadow: 0 6px 15px rgba(255, 122, 47, .11); transform: translateY(-2px); }
.bubble-tag.is-pressed { animation: none; transform: scale(.94); }
.bubble-tag.is-bursting { animation: bubble-burst 320ms ease-out forwards; pointer-events: none; }
.bubble-tag .bubble-icon { margin-right: 4px; color: var(--brand-orange-dark); font-size: 12px; }
.bubble-particle { position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; border-radius: 999px; background: var(--brand-orange); opacity: 0; pointer-events: none; }
.bubble-tag.is-bursting .bubble-particle { opacity: 1; animation: particle-pop 320ms ease-out forwards; }
.bubble-tag.is-bursting .bubble-particle:nth-child(1) { --x: -21px; --y: -17px; }
.bubble-tag.is-bursting .bubble-particle:nth-child(2) { --x: 22px; --y: -15px; animation-delay: 20ms; }
.bubble-tag.is-bursting .bubble-particle:nth-child(3) { --x: -24px; --y: 16px; animation-delay: 35ms; }
.bubble-tag.is-bursting .bubble-particle:nth-child(4) { --x: 25px; --y: 15px; animation-delay: 10ms; }
.bubble-tag.is-bursting .bubble-particle:nth-child(5) { --x: 0; --y: -24px; animation-delay: 30ms; }
.bubble-tag.is-bursting .bubble-particle:nth-child(6) { --x: 0; --y: 25px; animation-delay: 45ms; }
.bubble-tag.is-restoring { animation: bubble-restore 320ms ease-out both; }
@keyframes bubble-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bubble-burst { 0% { transform: scale(.94); opacity: 1; } 32% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(0); opacity: 0; } }
@keyframes particle-pop { 0% { transform: translate(-50%, -50%) scale(.4); } 100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1); opacity: 0; } }
@keyframes bubble-restore { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

.selected-wrap { min-height: 49px; margin: 6px 0 10px; padding: 12px 13px 10px; border-radius: 18px; background: var(--peach); }
.selected-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.selected-count { color: var(--brand-orange-dark); }
.selected-list { display: flex; flex-wrap: wrap; gap: 6px; }
.selected-tag { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px 6px 10px; border-radius: 999px; color: var(--brand-orange-dark); background: var(--white); font-size: 11px; }
.selected-tag button { width: 17px; height: 17px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--brand-orange-dark); background: var(--soft-orange); cursor: pointer; font-size: 12px; }
.undo-toast { position: fixed; z-index: 5; right: 50%; bottom: max(86px, calc(env(safe-area-inset-bottom) + 76px)); display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 8px 10px 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: rgba(255, 255, 255, .97); box-shadow: var(--shadow); transform: translateX(50%); font-size: 12px; }
.undo-toast button { border: 0; color: var(--brand-orange-dark); background: transparent; cursor: pointer; font-weight: 800; }

.goal-list { display: grid; gap: 10px; }
.goal-card { position: relative; width: 100%; padding: 16px 17px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--white); cursor: pointer; text-align: left; box-shadow: var(--shadow); }
.goal-card.selected { border: 2px solid var(--brand-orange); padding: 15px 16px; background: var(--soft-orange); }
.goal-card strong { display: block; margin-bottom: 4px; font-size: 15px; }
.goal-card span { color: var(--muted); font-size: 12px; }
.goal-check { position: absolute; top: 15px; right: 16px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--white); background: var(--brand-orange); font-size: 12px; opacity: 0; }
.goal-card.selected .goal-check { opacity: 1; }

.service-grid { display: grid; gap: 13px; margin-top: 23px; }
.service-card { position: relative; min-height: 158px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 23px; cursor: pointer; text-align: left; box-shadow: var(--shadow); }
.service-card.dating { background: var(--soft-orange); }
.service-card.event { background: var(--sage); }
.service-card h3 { margin: 0 0 7px; }
.service-card p { max-width: 235px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.service-card .card-bear { position: absolute; right: 15px; bottom: -4px; width: 72px; height: 72px; }
.service-card .card-arrow { position: absolute; right: 17px; top: 17px; color: var(--brand-orange-dark); font-size: 20px; }
.safety-note { display: flex; gap: 9px; margin-top: 23px; padding: 12px; border-radius: 16px; color: var(--muted); background: var(--peach); font-size: 11px; line-height: 1.55; }
.safety-note span { color: var(--brand-orange); font-size: 15px; }

.loading-page { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.loading-page .bear-mascot { width: 132px; height: 132px; margin-bottom: 22px; }
.loading-page h2 { max-width: 300px; }
.loading-copy { min-height: 45px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.loading-dots { display: flex; gap: 6px; justify-content: center; margin-top: 17px; }
.loading-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-orange); animation: loading-dot 1.1s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: 140ms; }
.loading-dots i:nth-child(3) { animation-delay: 280ms; }
@keyframes loading-dot { 0%, 70%, 100% { opacity: .35; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-5px); } }

.result-card { margin-top: 23px; padding: 20px; border: 1px solid var(--line); border-radius: 23px; background: var(--white); box-shadow: var(--shadow); }
.result-label { margin-bottom: 17px; color: var(--brand-orange-dark); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.match-line { gap: 11px; }
.neutral-avatar { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 18px; color: var(--brand-orange-dark); background: var(--peach-deep); font-size: 19px; font-weight: 800; }
.match-line .muted { margin: 0; }
.score { margin-left: auto; color: var(--brand-orange-dark); font-size: 13px; font-weight: 800; }
.why-title { margin: 19px 0 9px; font-size: 12px; font-weight: 800; }
.reason-list { display: flex; flex-wrap: wrap; gap: 7px; }
.reason { padding: 7px 9px; border-radius: 10px; color: var(--muted); background: var(--peach); font-size: 11px; }
.event-card { overflow: hidden; padding: 0; }
.event-top { padding: 21px 20px 19px; background: var(--soft-orange); }
.event-top h3 { margin: 0; font-size: 23px; }
.event-body { padding: 19px 20px; }
.event-line { gap: 9px; margin: 9px 0; color: var(--muted); font-size: 12px; }
.event-line strong { color: var(--ink); font-size: 13px; }
.event-description { margin: 17px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
.avatar-row { gap: 0; margin-top: 17px; }
.mini-avatar { width: 29px; height: 29px; display: grid; place-items: center; margin-left: -6px; border: 2px solid var(--white); border-radius: 50%; color: var(--white); background: var(--bear); font-size: 10px; }
.mini-avatar:first-child { margin-left: 0; }
.mini-avatar:nth-child(2) { background: var(--brand-orange); }
.mini-avatar:nth-child(3) { color: var(--ink); background: var(--sage); }
.mini-avatar:nth-child(4) { color: var(--ink); background: var(--peach-deep); }
.member-label { margin-left: 9px; color: var(--muted); font-size: 11px; }
.bear-message { margin-top: 18px; }

.confirm-card { display: grid; gap: 14px; margin-top: 25px; padding: 20px; border-radius: 22px; background: var(--peach); }
.confirm-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.confirm-line strong { color: var(--ink); font-size: 13px; text-align: right; }
.confirm-bear { display: flex; justify-content: center; margin-top: 20px; }
.confirm-bear .bear-mascot { width: 92px; height: 92px; }
.success-page { display: flex; flex: 1; flex-direction: column; justify-content: center; }
.success-page .bear-mascot { width: 108px; height: 108px; margin-bottom: 21px; }
.success-page p { max-width: 310px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.feedback-question { margin: 24px 0; }
.feedback-question h3 { font-size: 15px; }
.stars { display: flex; gap: 7px; margin-top: 13px; }
.star { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; color: #D6CBC1; background: var(--white); cursor: pointer; font-size: 19px; }
.star.selected { border-color: var(--brand-orange); color: var(--brand-orange); background: var(--soft-orange); }
.option-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.option { min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--white); cursor: pointer; font-size: 12px; }
.option.selected { border-color: var(--brand-orange); color: var(--brand-orange-dark); background: var(--soft-orange); }
.safety-box { margin-top: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--peach); }
.safety-box h3 { margin-bottom: 6px; font-size: 14px; }
.safety-box p { margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.notice-line { margin: 8px 0; color: var(--brand-orange-dark); font-size: 12px; }

.settings-panel { display: grid; gap: 10px; margin-top: 17px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.setting-row { color: var(--muted); font-size: 12px; }
.toggle { width: 38px; height: 23px; padding: 3px; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; }
.toggle span { display: block; width: 17px; height: 17px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 4px rgba(76,50,30,.15); transition: transform 160ms ease; }
.toggle.is-on { background: var(--brand-orange); }
.toggle.is-on span { transform: translateX(15px); }

.screen-enter { animation: screen-enter 220ms ease both; }
@keyframes screen-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 600px) {
  .phone-shell { min-height: 780px; margin: 32px auto; border-radius: 24px; }
  .page { min-height: 780px; }
}

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

body.motion-reduced *, body.motion-reduced *::before, body.motion-reduced *::after { animation: none !important; transition: none !important; }
/* Mobile layout and accessibility refinements */
html, body { max-width: 100%; overflow-x: hidden; }
body { min-width: 0; }
.phone-shell, .page, .content { min-width: 0; max-width: 100%; }
.page {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.bottom-bar { padding-bottom: max(4px, env(safe-area-inset-bottom, 0px)); }
.button, .bubble-tag, .option, .icon-button, .star { min-height: 44px; touch-action: manipulation; }
.bottom-row { gap: 8px; }
.bottom-row .button { min-width: 0; }
.bubble-field { gap: 8px 7px; }
.bubble-tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.progress-row { min-width: 0; gap: 8px; }
.progress-label { min-width: 0; }
.progress-track { flex: 1 1 auto; width: auto; min-width: 72px; max-width: 136px; }
@media (max-width: 390px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .bubble-field { gap: 8px 6px; }
  .button { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-enter, .bubble-tag, .loading-dots i, .progress-track span {
    animation: none !important; transition: none !important;
  }
}
/* Scoped mascot frequency refinements */
.question-head > .bear-mascot,
.content > .bear-peek { display: none; }
/* Tag bubble visual refresh */
:root {
  --bubble-ivory: #FFFDF7;
  --bubble-apricot: #FFF0E5;
  --bubble-sage: #E3ECD9;
  --bubble-butter: #FFF7CC;
}
.question-head { padding-top: 4px; }
.question-head h2 { max-width: 320px; margin-bottom: 12px; text-align: left; }
.question-head .helper { max-width: 285px; margin-bottom: 34px; color: var(--weak); font-size: 13px; }
.bubble-field {
  min-height: 210px;
  gap: 14px 10px;
  padding: 16px 0 22px;
  align-content: center;
  overflow: visible;
}
.bubble-tag {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  border: 1px solid rgba(185, 130, 93, .16);
  border-radius: 48% 52% 46% 54% / 54% 44% 56% 46%;
  background: var(--bubble-ivory);
  box-shadow: 0 8px 22px rgba(76, 50, 30, .07), inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: transform 180ms ease, opacity 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
.bubble-variant-1 { border-radius: 48% 52% 46% 54% / 54% 44% 56% 46%; background: var(--bubble-ivory) !important; }
.bubble-variant-2 { border-radius: 58% 42% 54% 46% / 44% 58% 42% 56%; background: var(--bubble-apricot) !important; }
.bubble-variant-3 { border-radius: 43% 57% 51% 49% / 56% 46% 54% 44%; background: var(--bubble-sage) !important; }
.bubble-variant-4 { border-radius: 52% 48% 60% 40% / 46% 54% 44% 56%; background: var(--bubble-butter) !important; }
.bubble-tag:hover {
  border-color: rgba(185, 130, 93, .34);
  box-shadow: 0 10px 24px rgba(76, 50, 30, .09), inset 0 1px 0 rgba(255, 255, 255, .95);
}
.bubble-tag::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 7px;
  right: 18%;
  left: 18%;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .62);
  opacity: .62;
  pointer-events: none;
}
.bubble-tag::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -6px;
  border: 1px solid rgba(185, 130, 93, .28);
  border-radius: inherit;
  opacity: 0;
  transform: scale(.78);
  pointer-events: none;
}
.bubble-tag.is-pressed { animation: none; transform: scale(.97); }
.bubble-tag.is-bursting {
  z-index: 2;
  animation: bubble-pop 410ms cubic-bezier(.2, .8, .25, 1) both;
  pointer-events: none;
}
.bubble-tag.is-bursting::before { animation: bubble-glint 410ms ease-out both; }
.bubble-tag.is-bursting::after { animation: bubble-ring 410ms ease-out both; }
.bubble-tag.is-bursting .bubble-particle { animation-duration: 410ms; }
@keyframes bubble-pop {
  0% { opacity: 1; transform: scale(.97); }
  18% { opacity: 1; transform: scale(1.08); }
  48% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(.72); }
}
@keyframes bubble-glint {
  0% { opacity: .62; transform: scaleX(.7); }
  24% { opacity: 1; transform: scaleX(1.2); }
  100% { opacity: 0; transform: scaleX(1.5); }
}
@keyframes bubble-ring {
  0% { opacity: 0; transform: scale(.78); }
  24% { opacity: .48; transform: scale(.98); }
  100% { opacity: 0; transform: scale(1.26); }
}
.selected-wrap {
  margin-top: 14px;
  animation: selected-area-in 220ms ease both;
}
.selected-list { gap: 8px; }
.selected-tag { animation: selected-enter 220ms ease both; }
.selected-tag button { width: 24px; height: 24px; }
@keyframes selected-area-in {
  from { opacity: .6; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes selected-enter {
  from { opacity: 0; transform: translateY(4px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.bottom-bar {
  padding-top: 26px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}
.bottom-row { gap: 10px; }
.bottom-row .button { min-height: 52px; }
@media (max-width: 390px) {
  .question-head .helper { margin-bottom: 28px; }
  .bubble-field { gap: 11px 7px; padding-top: 14px; padding-bottom: 18px; }
  .bubble-tag { padding-right: 12px; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble-tag,
  .bubble-tag::before,
  .bubble-tag::after,
  .bubble-tag .bubble-particle,
  .selected-wrap,
  .selected-tag {
    animation: none !important;
    transition: color .01ms, background-color .01ms, opacity .01ms !important;
  }
  .bubble-tag.is-bursting { opacity: .55; transform: none; }
}
body.motion-reduced .bubble-tag,
body.motion-reduced .bubble-tag::before,
body.motion-reduced .bubble-tag::after,
body.motion-reduced .selected-wrap,
body.motion-reduced .selected-tag {
  animation: none !important;
}
body.motion-reduced .bubble-tag.is-bursting { opacity: .55; transform: none; }

.history-link {
  border: 0;
  padding: 4px 0;
  color: var(--brand-orange-dark);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}
.history-link:hover { color: var(--brand-orange); }
.history-page { padding: 22px 0 20px; }
.history-page h2 { margin-bottom: 12px; }
.history-group { margin-top: 24px; }
.history-group h3 { margin-bottom: 9px; color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.history-tag-list { display: grid; gap: 8px; }
.history-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.history-delete {
  border: 0;
  padding: 5px 0 5px 12px;
  color: var(--brand-orange-dark);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}
.history-delete:hover { color: var(--brand-orange); }
.history-empty { margin-top: 28px; color: var(--weak); font-size: 13px; line-height: 1.7; }
@media (max-width: 390px) {
  .top-actions { gap: 5px; }
  .history-link { font-size: 10px; }
}
