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

html,
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  padding-bottom: 170px;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
  z-index: 0;
  mix-blend-mode: overlay;
}

button,
textarea,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
}

.screen {
  position: relative;
  z-index: 1;
}

.header {
  padding: 28px 22px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.greeting-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.greeting {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-toggle,
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.25s ease;
}

.theme-toggle:hover,
.icon-button:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.theme-toggle:active,
.icon-button:active { transform: scale(0.95); }

.rings-section {
  padding: 28px 22px 24px;
  position: relative;
  z-index: 1;
}

.primary-ring-container {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.ring-svg {
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 32px var(--ring-glow, var(--recovery-glow)));
}

.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 7;
}

.ring-progress {
  fill: none;
  stroke: var(--ring-color, var(--recovery));
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: var(--ring-circumference);
  stroke-dashoffset: var(--ring-circumference);
  animation: ring-fill 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ring-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ring-color, var(--recovery));
  margin-bottom: 6px;
  opacity: 0;
  animation: fade-up 0.7s ease 0.9s forwards;
}

.ring-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 64px;
  font-weight: 300;
  line-height: 1;
  color: var(--text-primary);
  opacity: 0;
  animation: fade-up 0.7s ease 1s forwards;
}

.ring-value .pct {
  font-size: 22px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 2px;
}

.ring-sublabel {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 300;
  opacity: 0;
  animation: fade-up 0.7s ease 1.1s forwards;
}

.secondary-rings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-ring-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: card-in 0.6s ease forwards;
  transition: border-color 0.25s, transform 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mini-ring-card:nth-child(1) { animation-delay: 1.2s; }
.mini-ring-card:nth-child(2) { animation-delay: 1.3s; }

.mini-ring-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--card-glow, transparent), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.mini-ring-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
}

.mini-ring-wrap { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.mini-ring-svg { transform: rotate(-90deg); }
.mini-ring-bg { fill: none; stroke: var(--border-bright); stroke-width: 4; }

.mini-ring-progress {
  fill: none;
  stroke: var(--ring-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: var(--ring-circumference);
  stroke-dashoffset: var(--ring-circumference);
  animation: ring-fill 1.5s cubic-bezier(0.4, 0, 0.2, 1) var(--ring-delay, 1.4s) forwards;
}

.mini-ring-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-ring-content { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.mini-ring-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.mini-ring-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  color: var(--ring-color);
}

.mini-ring-value .pct {
  font-size: 16px;
  color: var(--text-secondary);
}

.tip-card {
  margin: 8px 22px 0;
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(94,234,212,0.05), rgba(147,197,253,0.03));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: card-in 0.7s ease 1.5s forwards;
  z-index: 1;
}

.tip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--recovery), transparent);
  opacity: 0.6;
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tip-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--recovery);
  text-transform: uppercase;
}

.tip-icon { width: 14px; height: 14px; color: var(--recovery); }

.tip-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  font-weight: 300;
}

.section {
  padding: 0 22px;
  margin-top: 32px;
  position: relative;
  z-index: 1;
}

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  padding-left: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  animation: card-in 0.5s ease forwards;
  transition: border-color 0.25s, transform 0.25s;
  cursor: pointer;
}

.stat-card:nth-child(1) { animation-delay: 1.4s; }
.stat-card:nth-child(2) { animation-delay: 1.45s; }
.stat-card:nth-child(3) { animation-delay: 1.5s; }
.stat-card:nth-child(4) { animation-delay: 1.55s; }

.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.stat-icon { width: 22px; height: 22px; color: var(--text-secondary); }

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value .unit {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 4px;
  font-weight: 300;
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

.habits-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin: 0 -22px;
  padding: 0 22px 4px;
}

.habits-row::-webkit-scrollbar { display: none; }

.habit-card {
  min-width: 96px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
  opacity: 0;
  animation: card-in 0.5s ease forwards;
}

.habit-card:nth-child(1) { animation-delay: 1.6s; }
.habit-card:nth-child(2) { animation-delay: 1.65s; }
.habit-card:nth-child(3) { animation-delay: 1.7s; }
.habit-card:nth-child(4) { animation-delay: 1.75s; }
.habit-card:nth-child(5) { animation-delay: 1.8s; }

.habit-card:hover {
  border-color: var(--text-secondary);
  transform: translateY(-3px);
}

.habit-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.habit-label {
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.habit-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  min-height: 16px;
}

.habit-card.add {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-bright);
}

.now-playing {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  background: rgba(20, 20, 26, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease;
  opacity: 0;
  animation: np-rise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s forwards;
}

[data-theme="light"] .now-playing {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.now-playing:hover {
  transform: translateX(-50%) translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.np-cover {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 55%, #6366f1 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.np-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.np-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.np-track,
.np-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.np-track {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.np-artist {
  font-size: 11px;
  color: var(--text-secondary);
}

.np-eq {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eq-icon {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 12px;
  flex-shrink: 0;
}

.eq-icon span {
  width: 2px;
  background: var(--recovery);
  border-radius: 1px;
  transform-origin: bottom;
  animation: eq-bounce 1s ease-in-out infinite;
}

.eq-icon span:nth-child(1) { height: 45%; animation-delay: 0s; }
.eq-icon span:nth-child(2) { height: 100%; animation-delay: 0.18s; }
.eq-icon span:nth-child(3) { height: 70%; animation-delay: 0.36s; }

.np-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1.5px;
  width: var(--progress, 38%);
  background: linear-gradient(90deg, var(--recovery), var(--strain));
  box-shadow: 0 0 8px var(--recovery-glow);
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 16px 24px 24px;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 40%);
  display: flex;
  justify-content: space-around;
  z-index: 10;
}

.tab {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.25s;
  background: transparent;
  border: 1px solid transparent;
}

.tab:hover { color: var(--text-secondary); }

.tab.active {
  color: var(--text-primary);
  background: var(--surface);
  border-color: var(--border-bright);
}

.tab svg,
.icon-button svg,
.theme-toggle svg,
.stat-icon svg,
.habit-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.screen-placeholder {
  padding: 32px 22px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.habits-screen {
  padding: 28px 22px 0;
}

.screen-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.screen-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.category-button {
  min-height: 120px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s;
  opacity: 0;
  animation: card-in 0.5s ease forwards;
}

.category-button:nth-child(1) { animation-delay: 0.3s; }
.category-button:nth-child(2) { animation-delay: 0.38s; }
.category-button:nth-child(3) { animation-delay: 0.46s; }
.category-button:nth-child(4) { animation-delay: 0.54s; }

.category-button:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
}

.category-button svg {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
}

.category-button span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.habit-flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  opacity: 0;
  animation: card-in 0.5s ease 0.2s forwards;
}

.flow-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 18px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.choice-button,
.chip-button,
.primary-button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: 14px;
  min-height: 44px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.choice-button.active,
.chip-button.active {
  border-color: var(--recovery);
  background: var(--recovery-glow);
}

.choice-button:hover,
.chip-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  border-color: var(--border-bright);
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.range-input {
  width: 100%;
  accent-color: var(--recovery);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-tertiary);
  font-size: 11px;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.mood-grid svg {
  width: 24px;
  height: 24px;
}

.form-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 14px;
  outline: none;
  margin-bottom: 12px;
}

.form-textarea:focus {
  border-color: var(--border-bright);
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip-button {
  min-height: 38px;
  padding: 0 12px;
}

.primary-button {
  width: 100%;
  background: var(--recovery);
  color: var(--bg);
  border-color: var(--recovery);
  font-weight: 600;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 13px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: np-rise 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.period-switch {
  display: flex;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: 4px;
}

.period-button {
  min-height: 34px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-tertiary);
  padding: 0 10px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.period-button.active {
  background: var(--surface-2);
  color: var(--text-primary);
}

.trends-list {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  opacity: 0;
  animation: card-in 0.5s ease forwards;
}

.chart-card:nth-child(1) { animation-delay: 0.2s; }
.chart-card:nth-child(2) { animation-delay: 0.28s; }
.chart-card:nth-child(3) { animation-delay: 0.36s; }
.chart-card:nth-child(4) { animation-delay: 0.44s; }
.chart-card:nth-child(5) { animation-delay: 0.52s; }

.chart-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chart-title span:first-child {
  font-size: 14px;
  font-weight: 600;
}

.chart-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.chart-wrap {
  width: 100%;
  height: 160px;
}

.chart-wrap .uplot {
  background: transparent;
  font-family: 'JetBrains Mono', monospace;
}

.chart-empty {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 12px;
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.chart-stat {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-stat span:first-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-tertiary);
  font-size: 10px;
  text-transform: uppercase;
}

.chart-stat span:last-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  font-size: 14px;
}

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

.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  animation: card-in 0.5s ease forwards;
}

.goal-card:nth-child(1) { animation-delay: 1.85s; }
.goal-card:nth-child(2) { animation-delay: 1.9s; }
.goal-card:nth-child(3) { animation-delay: 1.95s; }
.goal-card:nth-child(4) { animation-delay: 2s; }

.goal-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.goal-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  color: var(--text-primary);
}

.settings-list {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.settings-row span:first-child {
  color: var(--text-secondary);
}

.settings-row span:last-child {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

.settings-action {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 18px;
  cursor: pointer;
  font-weight: 600;
}

.settings-input {
  width: 110px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

.chat-screen {
  min-height: calc(100vh - 88px);
  padding: 28px 18px 100px;
  display: flex;
  flex-direction: column;
}

.chat-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 4px 18px;
}

.chat-title {
  font-size: 24px;
  font-weight: 600;
}

.chat-clear {
  min-height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 14px;
  padding: 0 12px;
  cursor: pointer;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  max-width: 84%;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  opacity: 0;
  animation: fade-up 0.3s ease forwards;
}

.message.user {
  align-self: flex-end;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 14px;
}

.message.assistant {
  align-self: flex-start;
  border-left: 1px solid var(--border-bright);
  padding: 4px 0 4px 14px;
  color: var(--text-primary);
}

.chat-input-bar {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(20, 20, 26, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 10px;
  z-index: 8;
}

[data-theme="light"] .chat-input-bar {
  background: rgba(255,255,255,0.78);
  border-color: rgba(0,0,0,0.06);
}

.chat-textarea {
  flex: 1;
  min-height: 42px;
  max-height: 140px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  padding: 10px 6px;
  line-height: 1.4;
}

.send-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--recovery);
  background: var(--recovery);
  color: var(--bg);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.send-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.send-button svg {
  width: 20px;
  height: 20px;
}
