:root {
  --bg: linear-gradient(135deg, #f8f8f8, #ececec);
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --accent: #6b7280;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;
  --border: #e5e7eb;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.10);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 720px;
  --transition: 0.2s ease;
  --sans: 'Nunito', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --bg-page: #f0eff4;
  --surface-hov: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --border: rgba(0, 0, 0, 0.07);
  --border2: rgba(0, 0, 0, 0.12);
  --purple: #c8b4f5;
  --green: #a8d8b0;
  --blue: #94c5f5;
  --amber: #f5c87a;
  --red: #f5a0a0;
  --accent-green: #2db87a;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --text: #1a1d2e;
  --muted: #6b7280;
  --subtle: #9ca3af;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}



::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}


* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
}

.hidden {
  display: none !important;
}

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s ease;
}

.boot-fluid-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.boot-overlay--fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-container {
  width: 100%;
  max-width: 960px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 3.5rem;
  animation: fadeIn 0.5s ease;
}

.boot-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.boot-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.8s ease;
}

.boot-photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.boot-intro {
  text-align: center;
}

.boot-intro__greeting {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
  animation: boot-intro-fade 1s ease;
}

.boot-intro__name {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.35rem;
  animation: boot-intro-fade 1s ease;
}

@keyframes boot-blink-caret {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes boot-intro-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes boot-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.boot-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.boot-status {
  font-size: 0.81rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
  min-height: 1.2em;
}


.shimmer {
  color: rgba(255, 255, 255, 0.1);
  background: -webkit-gradient(linear, left top, right top, from(#222), to(#222), color-stop(0.5, #fff));
  background: -moz-gradient(linear, left top, right top, from(#222), to(#222), color-stop(0.5, #fff));
  background: gradient(linear, left top, right top, from(#222), to(#222), color-stop(0.5, #fff));
  -webkit-background-size: 125px 100%;
  -moz-background-size: 125px 100%;
  background-size: 125px 100%;
  -webkit-background-clip: text;
  -moz-background-clip: text;
  background-clip: text;
  -webkit-animation-name: shimmer;
  -moz-animation-name: shimmer;
  animation-name: shimmer;
  -webkit-animation-duration: 2s;
  -moz-animation-duration: 2s;
  animation-duration: 2s;
  -webkit-animation-iteration-count: infinite;
  -moz-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-color: #222;
}

@-moz-keyframes shimmer {
  0% {
    background-position: top left;
  }

  100% {
    background-position: top right;
  }
}

@-webkit-keyframes shimmer {
  0% {
    background-position: top left;
  }

  100% {
    background-position: top right;
  }
}

@-o-keyframes shimmer {
  0% {
    background-position: top left;
  }

  100% {
    background-position: top right;
  }
}

@keyframes shimmer {
  0% {
    background-position: top left;
  }

  100% {
    background-position: top right;
  }
}



.boot-status--ready {
  color: #22c55e;
  font-weight: 600;
}

.boot-showcase {
  width: 100%;
  min-height: 110px;
  position: relative;
}

.boot-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(9.5px);
  -webkit-backdrop-filter: blur(9.5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  animation: boot-card-in 0.7s cubic-bezier(0.25, 1, 0.5, 1) both;
  min-height: 9rem;
}

.boot-card--out {
  animation: boot-card-out 0.5s ease both;
}

@keyframes boot-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes boot-card-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

.boot-card__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-hover);
  margin-bottom: 0.5rem;
}

.boot-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.boot-card__desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.boot-fact {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
  min-height: 2.8em;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .boot-container {
    flex-direction: column;
    padding: 2rem 1.25rem;
    gap: 2rem;
    max-width: 520px;
  }

  .boot-left {
    flex-direction: row;
    gap: 1.25rem;
    text-align: left;
    width: 100%;
  }

  .boot-intro {
    text-align: left;
  }

  .boot-photo {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
  }

  .boot-intro__name {
    font-size: 2rem;
  }

  .boot-intro__greeting {
    font-size: 0.88rem;
  }
}

@media (max-width: 640px) {
  .boot-container {
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  .boot-photo {
    width: 80px;
    height: 80px;
  }

  .boot-intro__name {
    font-size: 1.7rem;
  }

  .boot-intro__greeting {
    font-size: 0.82rem;
  }

  .boot-steps {
    gap: 0.35rem;
  }

  .boot-step {
    font-size: 0.76rem;
  }

  .boot-card {
    padding: 1rem 1.15rem;
  }

  .boot-card__title {
    font-size: 0.92rem;
  }

  .boot-card__desc {
    font-size: 0.78rem;
  }

  .boot-fact {
    font-size: 0.76rem;
  }
}

@media (max-width: 380px) {
  .boot-container {
    padding: 1rem 0.75rem;
    gap: 1.25rem;
  }

  .boot-photo {
    width: 64px;
    height: 64px;
  }

  .boot-intro__name {
    font-size: 1.5rem;
  }

  .boot-intro__greeting {
    font-size: 0.78rem;
  }

  .boot-step {
    font-size: 0.72rem;
  }

  .boot-card__title {
    font-size: 0.85rem;
  }
}

.fluid-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.fluid-canvas--hidden {
  opacity: 0;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  transition: min-height 0.4s ease;
  overflow-y: auto;
  flex-shrink: 0;
  justify-content: center;
}

.hero--compact {
  min-height: auto;
  padding: 1.5rem 1.5rem 0.5rem;
  flex-shrink: 0;
  overflow-y: auto;
}

.hero--compact .hero__greeting,
.hero--compact .hero__title {
  display: none;
}

.hero--compact .hero__avatar {
  margin-bottom: 1rem;
}

.hero--compact .avatar-placeholder {
  width: 80px;
  height: 80px;
}

.hero__greeting {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  animation: drop-in 0.8s ease-out forwards;
}

.hero__title {
  font-family: "Just Another Hand", cursive;
  font-size: 2.9rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 2rem;
  max-width: 600px;
  letter-spacing: 0.13em;
  animation: drop-in 0.8s ease-out forwards;
}

.hero__avatar {
  margin-bottom: 2.5rem;
}

.avatar-placeholder {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin: 0 auto;
}

.avatar--large {
  width: 160px;
  height: 160px;
  font-size: 3.5rem;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(9.5px);
  -webkit-backdrop-filter: blur(9.5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 100px;
  padding: 0.35rem 0.35rem 0.35rem 1.25rem;
  width: 100%;
  max-width: 520px;
  min-width: 400px;
  margin: 0 auto;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: drop-in-bottom 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.chat-input:focus-within {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.chat-input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
}

.chat-input input::placeholder {
  color: var(--text-secondary);
}

.chat-submit {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(9.5px);
  -webkit-backdrop-filter: blur(9.5px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.chat-submit:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.chat-submit:active {
  transform: scale(0.95);
}

.hero__actions,
.bottom-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1.5rem;
  max-width: 800px;
  animation: drop-in-bottom 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.95rem 1.8rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 129px;

  background: rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(9.5px);
  -webkit-backdrop-filter: blur(9.5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

.action-btn__icon {
  font-size: 1.2rem;
}

.inline-profile {
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 2rem;
  padding: 1.5rem 0;
  background: transparent;
  animation: fadeIn 0.3s ease;
}

.inline-profile__avatar {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-profile__avatar .avatar-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
}

.inline-profile__content {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.inline-profile__name {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.inline-profile__title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.inline-profile__summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.inline-profile__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  background: transparent;
  border: 1.5px solid var(--text);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
}

.chat-section {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 160px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  max-width: 90%;
  font-size: 0.92rem;
  line-height: 1.65;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble--user {
  background: var(--accent);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble--fade {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-4px);
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
}

.chat-bubble--assistant {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}


.chat-bubble--assistant h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1rem 0 0.4rem;
  color: var(--text);
}

.chat-bubble--assistant h2 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0.9rem 0 0.35rem;
  color: var(--text);
}

.chat-bubble--assistant h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.75rem 0 0.3rem;
  color: var(--text);
}

.chat-bubble--assistant h1:first-child,
.chat-bubble--assistant h2:first-child,
.chat-bubble--assistant h3:first-child {
  margin-top: 0;
}

.chat-bubble--assistant p {
  margin: 0.4rem 0;
  line-height: 1.7;
}

.chat-bubble--assistant p:first-child {
  margin-top: 0;
}

.chat-bubble--assistant p:last-child {
  margin-bottom: 0;
}

.chat-bubble--assistant ul,
.chat-bubble--assistant ol {
  padding-left: 1.35rem;
  margin: 0.4rem 0;
}

.chat-bubble--assistant li {
  margin: 0.25rem 0;
  line-height: 1.6;
}

.chat-bubble--assistant li::marker {
  color: var(--accent);
}

.chat-bubble--assistant strong {
  font-weight: 600;
  color: var(--text);
}

.chat-bubble--assistant code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.84em;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: #e11d48;
}

.chat-bubble--assistant pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  margin: 0.5rem 0;
  font-size: 0.82em;
  line-height: 1.5;
}

.chat-bubble--assistant pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.chat-bubble--assistant blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.3rem 0 0.3rem 0.85rem;
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.chat-bubble--assistant hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.75rem 0;
}

.chat-bubble--assistant a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-bubble--assistant table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.88em;
}

.chat-bubble--assistant th,
.chat-bubble--assistant td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.chat-bubble--assistant th {
  background: #f8fafc;
  font-weight: 600;
}


/* Loading indicator: pixel-grid loader + shimmering word + live timer */
.gen-progress {
  align-self: flex-start;
  display: flex;
  align-items: center;
  /* 0.45rem keeps the icon start at the bubble edge while the label lines up
     with the pipeline label and the answer text. */
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.35rem 0 0.55rem;
  margin-bottom: 0.15rem;
  animation: fadeIn 0.3s ease;
}

.gen-progress__grid {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 1.5px;
}

.gen-progress__cell {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--text);
  opacity: 0.15;
  animation: gen-pixel-on 650ms ease-in-out infinite;
}

@keyframes gen-pixel-on {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.85; }
}

.gen-progress__label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: opacity 0.22s ease;
}

.gen-progress__label--fade {
  opacity: 0;
}

.gen-progress__timer {
  font-family: var(--mono, monospace);
  font-size: 0.72rem;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .gen-progress__cell {
    animation: none;
    opacity: 0.35;
  }
}

.gen-progress--out {
  animation: gen-progress-out 0.38s ease forwards;
  pointer-events: none;
}

@keyframes gen-progress-out {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 80px;
  }

  to {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
}

.gen-shimmer {
  color: var(--text-secondary);
  background: linear-gradient(90deg,
      var(--text-secondary) 0%,
      var(--text-secondary) 38%,
      #9ca3af 50%,
      var(--text-secondary) 62%,
      var(--text-secondary) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gen-shimmer-sweep 2.8s ease-in-out infinite;
}

@keyframes gen-shimmer-sweep {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.chat-bubble--typing {
  display: flex;
  gap: 4px;
  padding: 1rem 1.5rem;
}

.chat-error {
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.1rem 0.25rem;
  animation: fadeIn 0.3s ease;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-6px);
  }
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: 0.75rem 1.5rem;
  z-index: 100;
}

.bottom-bar__actions {
  margin: 0 auto;
  max-width: var(--max-w);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
}

.bottom-bar__actions--visible {
  opacity: 1;
  max-height: 200px;
  margin-bottom: 0.6rem;
}

.bottom-bar__actions .action-btn {
  flex-direction: row;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  min-width: auto;
  gap: 0.4rem;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid grey;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.bottom-bar__actions .action-btn:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.bottom-bar__actions .action-btn__icon {
  font-size: 0.92rem;
}

.chat-input--bottom {
  max-width: var(--max-w);
  transition: max-width 0.3s ease, border-color var(--transition), box-shadow var(--transition);
}

.chat-input--bottom.chat-input--collapsed {
  max-width: 280px;
}

.chat-input--bottom.chat-input--collapsed .chat-submit {
  width: 34px;
  height: 34px;
}

.bottom-bar__powered {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.bottom-bar__powered strong {
  color: var(--text);
}

@media (max-width: 768px) {
  .hero {
    padding: 2rem 1rem 1.5rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  .avatar-placeholder {
    width: 180px;
    height: 180px;
  }

  .chat-input {
    min-width: 0;
    max-width: 480px;
  }

  .hero__actions,
  .bottom-bar__actions {
    gap: 1rem;
  }

  .action-btn {
    padding: 1.4rem 1.2rem;
    min-width: 110px;
  }

  .inline-profile {
    gap: 1.5rem;
  }

  .inline-profile__name {
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  :root {
    --radius: 12px;
    --radius-sm: 8px;
  }

  body {
    font-size: 15px;
  }

  .hero {
    padding: 1.5rem 1rem 1rem;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: flex-start;
    overflow-y: auto;
  }

  .hero::before {
    content: "";
    flex: 1 0 0px;
  }

  .hero::after {
    content: "";
    flex: 2 0 0px;
  }

  .hero__greeting {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
  }

  .hero__title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    max-width: 90vw;
  }

  .hero__avatar {
    margin-bottom: 1rem;
  }

  .avatar-placeholder {
    width: 120px;
    height: 120px;
    font-size: 1.8rem;
  }

  .avatar--large {
    width: 100px;
    height: 100px;
    font-size: 2rem;
  }

  .hero--compact {
    padding: 0.75rem 1rem 0.25rem;
    min-height: auto;
  }

  .hero--compact::before,
  .hero--compact::after {
    display: none;
  }

  .hero--compact .avatar-placeholder {
    width: 48px;
    height: 48px;
  }

  .hero--compact .hero__avatar {
    margin-bottom: 0.25rem;
  }

  .chat-input {
    min-width: 0;
    max-width: 100%;
    padding: 0.3rem 0.3rem 0.3rem 1rem;
  }

  .chat-input input {
    font-size: 0.9rem;
  }

  .chat-submit {
    width: 36px;
    height: 36px;
  }

  .hero__actions {
    gap: 0.5rem;
    margin-top: 0.75rem;
    max-width: 100%;
    padding: 0;
  }

  .hero__actions .action-btn {
    padding: 0.7rem 0.5rem;
    min-width: 0;
    flex: 1 1 calc(33.33% - 0.5rem);
    max-width: calc(33.33% - 0.35rem);
    font-size: 0.72rem;
    gap: 0.2rem;
    border-radius: 12px;
  }

  .hero__actions .action-btn__icon {
    font-size: 1rem;
  }

  .bottom-bar__actions {
    gap: 0.4rem;
    margin-top: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .bottom-bar__actions--visible {
    margin-bottom: 0.4rem;
    padding-bottom: 2px;
  }

  .bottom-bar__actions::-webkit-scrollbar {
    display: none;
  }

  .bottom-bar__actions .action-btn {
    flex: 0 0 auto;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    gap: 0.25rem;
    white-space: nowrap;
  }

  .bottom-bar__actions .action-btn__icon {
    font-size: 0.8rem;
  }

  .inline-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1rem 0;
  }

  .inline-profile__avatar,
  .inline-profile__content {
    width: 100%;
  }

  .inline-profile__avatar .avatar-img {
    max-width: 200px;
  }

  .inline-profile__name {
    font-size: 1.4rem;
  }

  .inline-profile__title {
    font-size: 0.82rem;
  }

  .inline-profile__summary {
    font-size: 0.84rem;
  }

  .inline-profile__skills {
    justify-content: center;
  }

  .skill-tag {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
  }


  .chat-section {
    padding: 0 0.75rem;
    padding-bottom: 130px;
  }

  .chat-messages {
    gap: 0.75rem;
  }

  .chat-bubble {
    max-width: 95%;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .chat-bubble--assistant {
    max-width: 100%;
  }

  .chat-bubble--assistant p {
    line-height: 1.6;
  }

  .chat-bubble--assistant ul,
  .chat-bubble--assistant ol {
    padding-left: 1.15rem;
  }

  .chat-bubble--assistant li {
    font-size: 0.86rem;
  }

  .chat-bubble--assistant pre {
    font-size: 0.76em;
    padding: 0.7rem 0.8rem;
  }


  .bottom-bar {
    padding: 0.5rem 0.75rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }


  .chat-input--bottom {
    max-width: 100%;
    min-width: 0;
  }

  .chat-input--bottom.chat-input--collapsed {
    max-width: 220px;
  }

  .chat-input--bottom.chat-input--collapsed .chat-submit {
    width: 32px;
    height: 32px;
    margin-left: -0.9em;
  }

  .bottom-bar__powered {
    font-size: 0.65rem;
    margin-top: 0.3rem;
  }


  .follow-ups {
    padding: 0 4px;
  }

  .follow-ups__label {
    font-size: 0.72rem;
    margin-bottom: 4px;
  }

  .follow-up-btn {
    font-size: 0.78rem;
  }


  .tp-wrapper {
    max-width: 100%;
  }

  .tp-toggle {
    font-size: 0.68rem;
  }

  .tp-step {
    font-size: 0.68rem;
    padding: 0.1rem 0 0.1rem 0.5rem;
  }

  .tp-step--detail {
    font-size: 0.64rem;
    padding-left: 1.2rem;
  }

  .tp-step--total {
    font-size: 0.64rem;
  }
}


@media (max-width: 380px) {
  .hero {
    padding: 1rem 0.75rem 0.5rem;
  }

  .hero__greeting {
    font-size: 0.85rem;
  }

  .hero__title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .hero__avatar {
    margin-bottom: 0.75rem;
  }

  .avatar-placeholder {
    width: 90px;
    height: 90px;
  }

  .hero--compact .avatar-placeholder {
    width: 40px;
    height: 40px;
  }

  .hero__actions .action-btn {
    padding: 0.55rem 0.4rem;
    font-size: 0.68rem;
  }

  .hero__actions .action-btn__icon {
    font-size: 0.9rem;
  }

  .chat-input {
    padding: 0.25rem 0.25rem 0.25rem 0.85rem;
  }

  .chat-input input {
    font-size: 0.85rem;
  }

  .chat-bubble {
    padding: 0.7rem 0.85rem;
    font-size: 0.84rem;
  }

  .chat-section {
    padding: 0 0.5rem;
    padding-bottom: 120px;
  }

  .inline-profile__avatar .avatar-img {
    max-width: 160px;
  }

  .inline-profile__name {
    font-size: 1.2rem;
  }

  .follow-up-btn {
    font-size: 0.74rem;
  }

  .bottom-bar {
    padding: 0.4rem 0.5rem;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
  }
}




@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



.tp-wrapper {
  align-self: flex-start;
  max-width: 90%;
  animation: fadeIn 0.3s ease;
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
}

.tp-wrapper--collapsed>.tp-steps {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.15s ease;
}

.tp-wrapper:not(.tp-wrapper--collapsed)>.tp-steps {
  max-height: 2000px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.tp-header {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: -0.35rem;
}

.tp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: none;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease, color var(--transition);
}

.tp-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

.tp-toggle__spark {
  flex-shrink: 0;
  fill: var(--subtle);
  transition: fill 0.3s ease;
}

.tp-toggle__spark--done {
  fill: var(--border2);
}

.tp-toggle__label {
  white-space: nowrap;
  color: var(--text-secondary);
}

.tp-toggle__chev {
  flex-shrink: 0;
  color: var(--subtle);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.tp-wrapper:not(.tp-wrapper--collapsed) .tp-toggle__chev {
  transform: rotate(180deg);
}


.tp-steps {
  padding: 0.35rem 0 0.2rem 0;
  margin-left: 0.5rem;
  margin-top: 0.1rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--border);
}

.tp-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.55rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  animation: fade-up 0.32s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-step__text {
  min-width: 0;
}

.tp-step--done .tp-step__check {
  display: inline-flex;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  width: 0.9rem;
  justify-content: center;
}

.tp-step--running .tp-step__spinner {
  width: 0.7rem;
  height: 0.7rem;
  /* 0.1rem side margins make the footprint 0.9rem — matching the check slot —
     so the running step's text lines up with the completed steps. */
  margin: 0 0.1rem;
  border: 1.5px solid var(--border2);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: tp-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes tp-spin {
  to {
    transform: rotate(360deg);
  }
}

.tp-step--detail {
  min-height: 0;
  padding-left: 1.3rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.tp-step--total {
  padding-left: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.1rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
  opacity: 0.85;
}



@media (max-width: 640px) {
  .tp-wrapper {
    max-width: 100%;
  }
}

@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drop-in-bottom {
  from {
    opacity: 0;
    transform: translateY(100px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



.follow-ups {
  max-width: var(--max-w);
  padding: 0 8px;
  margin-top: 0.4rem;
  animation: fadeIn 0.3s ease;
}

.follow-ups__label {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
  padding-left: 2px;
}

.follow-ups__buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.follow-up-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
  line-height: 1.3;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fade-up 0.35s cubic-bezier(0.23, 1, 0.32, 1) var(--fu-delay, 0ms) both;
}

.follow-up-btn__icon {
  flex-shrink: 0;
  color: var(--subtle);
}

.follow-up-btn__text {
  flex: 1;
}

.follow-up-btn:hover {
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.follow-up-btn:active {
  transform: translateY(0.5px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.follow-up-btn--used {
  opacity: 0.4;
  pointer-events: none;
}

.follow-up-btn--active {
  color: var(--accent-hover);
  opacity: 0.7;
}

.chat-bubble--appear {
  animation: stream-in 0.42s cubic-bezier(0.22, 0.61, 0.25, 1) both;
}

@keyframes stream-in {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(2px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* Copy button sits in the pipeline header, next to the summary label */
.tp-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  animation: fade-in 0.3s ease both;
}

.tp-copy:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

.tp-copy--done {
  color: var(--accent-green);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-bubble--appear,
  .tp-copy,
  .follow-up-btn {
    animation: none;
  }
}




.chat-bubble--assistant strong {
  color: var(--text);
  font-weight: 700;
}

.chat-bubble--assistant li {
  margin-bottom: 5px;
  line-height: 1.5;
}

@media (max-width: 600px) {

  .follow-up-btn {
    font-size: 0.78rem;
  }
}

/* ── Under the hood — subtle interactive pipeline flowchart ──────────────── */

.uth-trigger {
  position: absolute;
  top: 8em;
  right: 8em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-hov, rgba(255, 255, 255, 0.7));
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.uth-trigger:hover {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.uth-trigger .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subtle);
  transition: background 0.15s;
}

.uth-trigger:hover .live-dot {
  background: var(--accent-green);
}

.uth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 29, 46, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.uth-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.uth-modal {
  display: flex;
  flex-direction: column;
  width: 880px;
  max-width: 100%;
  max-height: 86vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.2s ease;
}

.uth-overlay.open .uth-modal {
  transform: none;
}

.uth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.uth-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.uth-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.uth-subtitle {
  font-size: 12px;
  color: var(--subtle);
}

.uth-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.14s, color 0.14s;
}

.uth-close:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.uth-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Flowchart (left column) */
.uth-pipeline {
  flex-shrink: 0;
  width: 264px;
  padding: 16px 14px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.uth-flow {
  display: flex;
  flex-direction: column;
}

.uth-node {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.14s, border-color 0.14s;
}

.uth-node:hover {
  background: rgba(0, 0, 0, 0.03);
}

.uth-node.is-active {
  border-color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.035);
}

.uth-node__num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
  background: var(--surface);
}

.uth-node.is-active .uth-node__num {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.uth-node__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.uth-node__name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.uth-node__meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uth-flow__link {
  width: 1px;
  height: 12px;
  margin-left: 22px;
  background: var(--border2);
}

/* Detail (right column) */
.uth-detail {
  flex: 1;
  min-width: 0;
  padding: 20px 22px;
  overflow-y: auto;
}

.uth-detail__step {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
  margin-bottom: 6px;
}

.uth-detail__title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.uth-detail__desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.uth-facts {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.uth-fact {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.uth-fact__k {
  flex-shrink: 0;
  width: 122px;
  color: var(--subtle);
}

.uth-fact__v {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
}

.uth-why {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.uth-why__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
  margin-bottom: 5px;
}

.uth-why__text {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.uth-footer {
  border-top: 1px solid var(--border);
  padding: 11px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-stat {
  font-size: 12px;
  color: var(--subtle);
}

.footer-stat span {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Global thin scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.24);
}

/* Desktop / large-tablet only — matches the original behaviour. */
@media (max-width: 860px) {
  .uth-trigger,
  .uth-overlay {
    display: none;
  }
}
