.openmuse-ui .home-welcome-refresh {
  position: absolute; z-index: 5; top: calc(var(--overlay-header-height) + .35rem); right: clamp(1rem, 3vw, 2.5rem);
  display: grid; width: 2.25rem; height: 2.25rem; place-items: center;
  border: 1px solid rgba(89, 113, 130, .13); border-radius: 50%;
  background: rgba(255, 255, 255, .64); color: #84919b;
  box-shadow: 0 .25rem 1rem rgba(48, 71, 91, .045); cursor: pointer;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.openmuse-ui .home-welcome-refresh[hidden] { display: none; }
.openmuse-ui .home-welcome-refresh:hover,
.openmuse-ui .home-welcome-refresh:focus-visible {
  color: #344957; background: rgba(255, 255, 255, .9);
  box-shadow: 0 .35rem 1rem rgba(48, 71, 91, .1);
}
.openmuse-ui .home-welcome-refresh .muse-icon { width: 1rem; height: 1rem; opacity: .65; }
.openmuse-ui .home-welcome-refresh:disabled { cursor: wait; }
.openmuse-ui .stage.main.home-welcome-home .mascot-stage .companion-pair { animation: none !important; }
.openmuse-ui .home-welcome-home { --quiet-home-content-height: 13.5rem; }
.openmuse-ui .thread-intro.muse-intro.home-welcome-home { width: 100%; }
.openmuse-ui .thread-intro.muse-intro.home-welcome-home .intro-copy,
.openmuse-ui .home-welcome-placeholder {
  width: min(43rem, 100%); min-height: var(--quiet-home-content-height);
  margin-inline: auto; text-align: center;
}
.openmuse-ui .thread-intro.muse-intro.home-welcome-home .intro-copy {
  display: flex; flex-direction: column; justify-content: center;
}
.openmuse-ui .home-welcome-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.openmuse-ui .home-welcome-waiting { display: flex; justify-content: center; gap: 0; }
.openmuse-ui .home-preparing-label {
  margin: 0 0 1.1rem; color: #7d8c96; font-size: .75rem; font-weight: 400; letter-spacing: .04em;
}
.openmuse-ui .home-loading-copy { display: grid; justify-items: center; gap: .8rem; width: 100%; }
.openmuse-ui :is(.home-loading-headline, .home-loading-description, .home-loading-topic, .home-loading-detail) {
  display: block; border-radius: 1rem;
  background: linear-gradient(105deg, #e8eef23d 12%, #d7eafa91 43%, #f6fafc 52%, #e8eef23d 82%);
  background-size: 240% 100%; animation: home-light-travel 3s ease-in-out infinite;
}
.openmuse-ui .home-loading-headline { height: 1.8rem; width: min(20rem, 78%); }
.openmuse-ui .home-loading-description { height: .65rem; width: min(26rem, 90%); }
.openmuse-ui .home-loading-prompts { width: 100%; }
.openmuse-ui .thread-intro.muse-intro .home-loading-prompt {
  overflow: hidden; position: relative; box-shadow: none; border-color: #b9cedc30;
  background: linear-gradient(145deg, #fff9, #f0f7fc66);
}
.openmuse-ui .home-loading-topic { height: .65rem; width: 47%; }
.openmuse-ui .home-loading-detail { height: .5rem; width: 86%; margin-top: .35rem; }
.openmuse-ui .home-loading-prompt:nth-child(2) span { animation-delay: .18s; }
.openmuse-ui .home-loading-prompt:nth-child(3) span { animation-delay: .36s; }
@keyframes home-light-travel { from { background-position: 160% 0; } to { background-position: -80% 0; } }
.openmuse-ui .home-welcome-signal {
  opacity: 0; color: #697176; font-size: 1rem; line-height: 1;
  animation: home-welcome-signal 2.1s ease-in-out 3s infinite;
}
@keyframes home-welcome-signal {
  0%, 100% { opacity: .05; }
  50% { opacity: .14; }
}
@keyframes home-welcome-appear {
  from { opacity: 0; filter: blur(var(--quiet-blur, 3px)); transform: translateY(var(--quiet-shift, .125rem)); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes home-welcome-sharpen {
  from { opacity: var(--quiet-stale-opacity, .4); filter: blur(var(--quiet-stale-blur, 3px)); transform: translateY(.125rem); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
.openmuse-ui .home-welcome-stale .intro-copy > :is(.kicker, h1, p):not(.is-sharp),
.openmuse-ui .home-welcome-stale .prompt-chip :is(strong, .prompt-chip-detail):not(.is-sharp) {
  opacity: var(--quiet-stale-opacity, .4); filter: blur(var(--quiet-stale-blur, 3px));
}
.openmuse-ui .home-welcome-stale h1 { --quiet-stale-blur: 4px; --quiet-stale-opacity: .34; }
.openmuse-ui .home-welcome-stale .intro-copy > p { --quiet-stale-blur: 3px; --quiet-stale-opacity: .38; }
.openmuse-ui .home-welcome-stale .prompt-chip { --quiet-stale-blur: 3px; --quiet-stale-opacity: .38; }
.openmuse-ui .home-welcome-stale .prompt-chip:disabled { cursor: default; pointer-events: none; }
.openmuse-ui .home-welcome-stale .intro-copy > :is(.kicker, h1, p).is-sharp,
.openmuse-ui .home-welcome-stale .prompt-chip :is(strong, .prompt-chip-detail).is-sharp {
  animation: home-welcome-sharpen 540ms cubic-bezier(.22, 1, .36, 1) both;
}
.openmuse-ui .home-welcome-stale.home-welcome-quick .is-sharp { animation-duration: 340ms !important; }
.openmuse-ui .home-welcome-revealing .kicker,
.openmuse-ui .home-welcome-revealing h1,
.openmuse-ui .home-welcome-revealing .intro-copy > p,
.openmuse-ui .home-welcome-revealing .prompt-chip {
  animation: home-welcome-appear 560ms cubic-bezier(.22, 1, .36, 1) both;
}
.openmuse-ui .home-welcome-revealing h1 { --quiet-blur: 4px; --quiet-shift: .1875rem; animation-duration: 620ms; }
.openmuse-ui .home-welcome-home h1 { position: relative; isolation: isolate; }
.openmuse-ui .home-welcome-revealing h1::before {
  content: ''; position: absolute; z-index: -1; inset: -.6rem 15%; border-radius: 50%;
  background: radial-gradient(ellipse, #d3ebfa8c, transparent 70%);
  animation: home-greeting-light 800ms ease both; pointer-events: none;
}
@keyframes home-greeting-light { from { opacity: .8; transform: scale(.6); } to { opacity: 0; transform: scale(1.3); } }
.openmuse-ui .home-welcome-revealing .intro-copy > p { --quiet-blur: 3px; animation-delay: 110ms; animation-duration: 510ms; }
.openmuse-ui .home-welcome-revealing .prompt-chip { --quiet-blur: 2px; --quiet-shift: .1875rem; animation-delay: 210ms; animation-duration: 490ms; }
.openmuse-ui .home-welcome-revealing .prompt-chip:nth-child(2) { animation-delay: 240ms; }
.openmuse-ui .home-welcome-revealing .prompt-chip:nth-child(3) { animation-delay: 270ms; }
.openmuse-ui .home-welcome-revealing.home-welcome-quick .kicker,
.openmuse-ui .home-welcome-revealing.home-welcome-quick h1 { animation-duration: 340ms; }
.openmuse-ui .home-welcome-revealing.home-welcome-quick .intro-copy > p { animation-delay: 45ms; animation-duration: 320ms; }
.openmuse-ui .home-welcome-revealing.home-welcome-quick .prompt-chip { animation-delay: 90ms; animation-duration: 330ms; }
.openmuse-ui .home-welcome-revealing.home-welcome-quick .prompt-chip:nth-child(2) { animation-delay: 105ms; }
.openmuse-ui .home-welcome-revealing.home-welcome-quick .prompt-chip:nth-child(3) { animation-delay: 120ms; }
.openmuse-ui .home-welcome-error { color: #697176; font-size: 0.86rem; }
.openmuse-ui .home-welcome-retry { margin-top: 0.7rem; padding: 0.55rem 0.95rem; border: 0; border-radius: 2rem; background: #f1f2f3; color: #3f5363; cursor: pointer; }
.openmuse-ui .home-welcome-retry:hover { background: #e9f3fa; }
.openmuse-ui .thread-intro.muse-intro .intro-copy { max-width: min(43rem, 100%); }
.openmuse-ui .thread-intro.muse-intro .prompt-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 1.55rem;
}
.openmuse-ui .thread-intro.muse-intro .prompt-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.33rem;
  min-height: 4.25rem;
  padding: 0.88rem 1rem;
  border: 1px solid rgba(118, 137, 153, 0.12);
  border-radius: 1.1rem;
  background: linear-gradient(145deg, #fff, #f6f8fb);
  box-shadow: 0 0.35rem 1.35rem rgba(46, 65, 91, 0.045);
  text-align: left;
  line-height: 1.45;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.openmuse-ui .thread-intro.muse-intro .prompt-chip:hover,
.openmuse-ui .thread-intro.muse-intro .prompt-chip:focus-visible {
  transform: translateY(-0.15rem);
  background: #f3f8fd;
  box-shadow: 0 0.55rem 1.5rem rgba(46, 65, 91, 0.09);
}
.openmuse-ui .thread-intro.muse-intro .prompt-chip strong { font-size: 0.79rem; font-weight: 650; }
.openmuse-ui .thread-intro.muse-intro .prompt-chip-detail {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #737f8b;
  font-size: 0.71rem;
  font-weight: 400;
}
@media (max-width: 48rem) {
  .openmuse-ui .home-welcome-home { --quiet-home-content-height: 21.5rem; }
  .openmuse-ui .thread-intro.muse-intro .prompt-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .openmuse-ui .thread-intro.muse-intro .prompt-chip { min-height: 3.4rem; padding: 0.65rem 0.85rem; }
}
/* Mobile header occupies real space, so short Safari viewports cannot center
   the welcome underneath the companion. Overflow stays in the conversation. */
@media (max-width: 47.5rem) {
  .openmuse-ui .stage.main { --overlay-header-height: 7.5rem; }
  .openmuse-ui .stage-header.topbar {
    position: relative; flex: 0 0 var(--overlay-header-height);
    height: var(--overlay-header-height); min-height: var(--overlay-header-height);
    padding: .75rem 4.4% 0;
  }
  .openmuse-ui .muse-agent-identity { top: .375rem; }
  .openmuse-ui .muse-agent-identity .health-pill { display: none; }
  .openmuse-ui .home-welcome-refresh {
    top: calc(.75rem + env(safe-area-inset-top)); right: calc(4.4% + 3rem); width: 2.75rem; height: 2.75rem;
    border: 0; background: transparent; box-shadow: none;
  }
  .openmuse-ui .thread.timeline:not(.is-empty) { padding-top: .75rem; }
  .openmuse-ui .thread.timeline.is-empty { flex-direction: column; justify-content: flex-start; }
  .openmuse-ui .thread-intro.muse-intro {
    min-height: 0; flex: 0 0 auto; margin-block: auto; padding: .75rem 0 1.25rem;
  }
  .openmuse-ui .home-welcome-home { --quiet-home-content-height: 0rem; }
}
@media (max-width: 47.5rem) and (max-height: 36rem) {
  .openmuse-ui .stage.main { --overlay-header-height: 7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .openmuse-ui :is(.home-loading-headline, .home-loading-description, .home-loading-topic, .home-loading-detail) { animation: none; }
  .openmuse-ui .home-welcome-revealing h1::before { display: none; }
  .openmuse-ui .home-welcome-signal { display: none; }
  .openmuse-ui .home-welcome-stale .is-sharp { animation: none !important; }
  .openmuse-ui .home-welcome-revealing .kicker,
  .openmuse-ui .home-welcome-revealing h1,
  .openmuse-ui .home-welcome-revealing .intro-copy > p,
  .openmuse-ui .home-welcome-revealing .prompt-chip { animation: none; }
  .openmuse-ui .thread-intro.muse-intro .prompt-chip { transition: none; }
  .openmuse-ui .thread-intro.muse-intro .prompt-chip:hover { transform: none; }
}
/* ACPs world: a quiet invitation followed by conversational discovery bubbles. */
.openmuse-ui .thread-intro.muse-intro .home-explore-entry {
  position: relative;
  border-color: #87b4c94a;
  background: linear-gradient(125deg, #f0f9fc, #f8fafc 80%);
}
.openmuse-ui .thread-intro.muse-intro .home-explore-entry strong { color: #365d73; font-size: .78rem; }
.openmuse-ui .home-explore-entry::after { content: '↗'; position: absolute; right: .75rem; top: .65rem; color: #5a8ca5; font-size: .75rem; }
.openmuse-ui .home-agent-world {
  position: relative; margin-top: 1.25rem; width: 100%; text-align: left;
}
.openmuse-ui .home-agent-world::before {
  content: ''; position: absolute; top: -.65rem; left: 16%; width: 1px; height: .5rem; background: #b7cbd877;
}
.openmuse-ui .home-agent-world-heading { display: flex; gap: .6rem; align-items: center; justify-content: space-between; margin: 0 .2rem .65rem; }
.openmuse-ui .home-agent-world-kicker { font-size: .62rem; letter-spacing: .1em; color: #8a9ca6; font-weight: 550; }
.openmuse-ui .home-agent-world-hint { color: #94a0a8; font-size: .64rem; }
.openmuse-ui .home-agent-bubbles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.openmuse-ui .home-agent-bubble {
  position: relative; display: flex; flex-direction: column; gap: .65rem;
  padding: .95rem 1rem; min-width: 0; border: 1px solid #b6c8d329;
  border-radius: 1.1rem 1.1rem 1.1rem .35rem;
  background: linear-gradient(135deg, #ffffffed, #f5f8fae0);
  box-shadow: 0 .2rem 1rem #35526506; color: #425461; font: inherit;
  text-align: left; cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.openmuse-ui .home-agent-bubble:nth-child(even) { border-radius: 1.1rem 1.1rem .35rem 1.1rem; }
.openmuse-ui .home-agent-bubble:hover { transform: translateY(-2px); border-color: #8dafc17a; box-shadow: 0 .5rem 1.6rem #3552650d; }
.openmuse-ui .home-agent-bubble:focus-visible { outline: 2px solid #7fa8c1; outline-offset: 3px; }
.openmuse-ui .home-agent-bubble:disabled { cursor: wait; opacity: .6; }
.openmuse-ui .home-agent-bubble-heading { display: flex; align-items: center; gap: .5rem; }
.openmuse-ui .home-agent-bubble-heading strong { font-size: .72rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.openmuse-ui .home-agent-avatar { display: grid; place-items: center; flex: 0 0 1.45rem; height: 1.45rem; border-radius: .5rem; background: #e8f1f5; color: #678a9e; font-size: .66rem; }
.openmuse-ui .home-agent-bubble:nth-child(2n) .home-agent-avatar { background: #edf0f7; color: #8b91ad; }
.openmuse-ui .home-agent-bubble:nth-child(3n) .home-agent-avatar { background: #ecf2ed; color: #7e9a86; }
.openmuse-ui .home-agent-arrow { margin-left: auto; color: #9aafb9; font-size: .8rem; }
.openmuse-ui .home-agent-request { font-size: .72rem; line-height: 1.7; color: #70818b; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.openmuse-ui .home-agent-loading-note { margin: .3rem 0 .7rem; font-size: .7rem; color: #91a1ab; }
.openmuse-ui .home-agent-skeleton { min-height: 5.5rem; cursor: default; }
.openmuse-ui .home-agents-retry { border: 0; background: #eef5f8; color: #67879a; border-radius: 1rem; padding: .6rem .9rem; font: inherit; font-size: .72rem; cursor: pointer; }
.openmuse-ui .response-wait-progress { font-size: .72rem; color: #8297a5; line-height: 1.7; padding-left: .7rem; border-left: 2px solid #b6cedd66; }
@media (max-width: 48rem) {
  .openmuse-ui .home-agent-bubbles { gap: .5rem; }
  .openmuse-ui .home-agent-bubble { padding: .75rem; }
  .openmuse-ui .home-agent-world::before { left: 50%; }
}
@media (max-width: 25rem) {
  .openmuse-ui .home-agent-bubbles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .openmuse-ui .home-agent-bubble { transition: none; }
}

.openmuse-ui .thread-intro.muse-intro .home-topic-entry { background: linear-gradient(135deg, #faf9f7, #f6f5f3); border-color: #c9c1b62b; }
.openmuse-ui .home-agent-world-toggle { padding: .2rem 0 .2rem .5rem; border: 0; background: transparent; color: #8499a6; font-size: .64rem; cursor: pointer; }
.openmuse-ui .home-agent-world-toggle:hover { color: #426a81; }
.openmuse-ui .home-agent-bubble { gap: .35rem; padding: .75rem .85rem; background: #ffffff85; border-color: #b6c8d322; box-shadow: none; }
.openmuse-ui .home-agent-bubble-heading strong { color: #718591; font-size: .65rem; }
.openmuse-ui .home-agent-request { -webkit-line-clamp: 2; font-size: .7rem; color: #526b7a; }

/* Keep an expanded discovery grid below the floating identity on wide views. */
@media (min-width: 47.5625rem) {
  .openmuse-ui .stage.main.home-welcome-home .scroll-region { padding-top: calc(var(--overlay-header-height) + .5rem); }
}
