/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg-primary: #1C1C28;
  --bg-card: #252536;
  --bg-pill: #2A2A40;

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #BBBBCC;
  --text-muted: #8888AA;
  --text-label: #A5A5E8;

  /* Accent */
  --accent-mic: #FF6B6B;
  --accent-gold: #F0D0A0;
  --accent-gold-light: #FFE4A0;
  --accent-green: #C5E8D5;

  /* Glow (Halo emotions) */
  --glow-neutral: #F0EDE6;
  --glow-empathy: #B8D4E8;
  --glow-curious: #C5E8D5;
  --glow-happy: #FFE4A0;
  --glow-calm: #DAE8E0;
  --glow-excited: #F0D0A0;
  --glow-listening: #E8E0F0;
  --glow-thinking: #D0D8F0;

  /* Borders */
  --border-subtle: #2A2A3A;
  --border-strong: #3A3A5A;

  /* Layout */
  --tab-bar-height: 72px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
  --radius-card: 12px;
  --radius-button: 12px;
  --radius-pill: 8px;
  --radius-button-lg: 24px;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* ── App Container ── */
#app {
  height: 100%;
  padding-bottom: 0;
  overflow: hidden;
}

/* Status bar fade overlay — prevents content showing behind clock/battery */
#app::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--safe-area-top, 54px) + 8px);
  background: linear-gradient(to bottom, #0C0C1F 60%, rgba(12, 12, 31, 0));
  z-index: 50;
  pointer-events: none;
}

/* ── Screen Base ── */
.screen {
  min-height: 100%;
  padding: calc(24px + var(--safe-area-top)) 16px 24px;
  animation: screen-fade-in 0.3s ease-in-out;
  overflow-y: auto;
}

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

.screen h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.screen h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.screen p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.5;
}

/* ── Section Label ── */
.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
}

/* ── Pill Tags ── */
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-pill);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Buttons ── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: #1C1C28;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Mic Button ── */
.mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-mic);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mic-btn svg {
  width: 28px;
  height: 28px;
  color: #FFFFFF;
}

.mic-btn:active {
  transform: scale(0.95);
  transition: transform 0.15s ease-in-out;
}

.mic-btn.active::before,
.mic-btn.active::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent-mic);
  animation: mic-pulse 1.5s ease-out infinite;
}

.mic-btn.active::after {
  animation-delay: 0.5s;
}

@keyframes mic-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* ── Glow Circle (Avatar Placeholder) ── */
.halo-glow {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, #F0EDE6 0%, rgba(240, 208, 160, 0.15) 40%, transparent 70%);
  animation: glow-breathe 5s ease-in-out infinite;
  margin: 0 auto;
  transition: background 1.5s ease-in-out;
}

.halo-glow.small {
  width: 150px;
  height: 150px;
}

.halo-glow[data-emotion="empathy"] { background: radial-gradient(circle, var(--glow-empathy) 0%, transparent 70%); }
.halo-glow[data-emotion="curious"]  { background: radial-gradient(circle, var(--glow-curious) 0%, transparent 70%); }
.halo-glow[data-emotion="happy"]    { background: radial-gradient(circle, var(--glow-happy) 0%, transparent 70%); }
.halo-glow[data-emotion="calm"]     { background: radial-gradient(circle, var(--glow-calm) 0%, transparent 70%); }
.halo-glow[data-emotion="excited"]  { background: radial-gradient(circle, var(--glow-excited) 0%, transparent 70%); }
.halo-glow[data-emotion="listening"]{ background: radial-gradient(circle, var(--glow-listening) 0%, transparent 70%); }
.halo-glow[data-emotion="thinking"] { background: radial-gradient(circle, var(--glow-thinking) 0%, transparent 70%); }

@keyframes glow-breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.03); opacity: 1; }
}

/* ── Tab Bar (Figma — glass blur, rounded top) ── */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 0 16px;
  background: rgba(18, 18, 40, 0.4);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 28px 28px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 47px;
  z-index: 100;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-decoration: none;
  color: rgba(144, 159, 180, 0.5);
  border-radius: 9999px;
  transition: color 0.2s ease-in-out, background 0.2s ease-in-out;
  -webkit-tap-highlight-color: transparent;
}

.tab span {
  display: none;
}

.tab.active {
  color: #C8C6C3;
  background: rgba(200, 198, 195, 0.1);
  box-shadow: 0 0 20px rgba(200, 198, 195, 0.05);
}

.tab.active svg {
  fill: currentColor;
}

.tab svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease-in-out;
}

/* ── Home Screen (Figma) ── */
.screen-home {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 22px;
  background: #0C0C1F;
  overflow: hidden;
  animation: none;
}

/* Streak */
.home-streak-section {
  position: absolute;
  top: calc(16px + var(--safe-area-top, 54px));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.home-streak-dots {
  display: flex;
  gap: 30px;
  margin-bottom: 8px;
}

.home-streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.home-streak-dot {
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-streak-dot.filled {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(200, 198, 195, 0.3);
  padding: 1px;
  animation: dot-fill 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.home-streak-day:nth-child(1) .home-streak-dot.filled { animation-delay: 0ms; }
.home-streak-day:nth-child(2) .home-streak-dot.filled { animation-delay: 40ms; }
.home-streak-day:nth-child(3) .home-streak-dot.filled { animation-delay: 80ms; }
.home-streak-day:nth-child(4) .home-streak-dot.filled { animation-delay: 120ms; }
.home-streak-day:nth-child(5) .home-streak-dot.filled { animation-delay: 160ms; }
.home-streak-day:nth-child(6) .home-streak-dot.filled { animation-delay: 200ms; }
.home-streak-day:nth-child(7) .home-streak-dot.filled { animation-delay: 240ms; }

@keyframes dot-fill {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.home-streak-dot-inner {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: #C8C6C3;
  box-shadow: 0 0 6px 2px rgba(200, 198, 195, 0.4), 0 0 12px 4px rgba(255, 233, 183, 0.15);
}

.home-streak-dot.empty {
  width: 4px;
  height: 4px;
  background: rgba(30, 30, 89, 0.5);
}

.home-streak-letter {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 400;
  color: rgba(144, 159, 180, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.home-streak-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 400;
  color: rgba(144, 159, 180, 0.5);
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

/* Avatar */
.home-avatar-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 320px;
  height: 320px;
  margin-top: 16px;
  z-index: 2;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.4s ease;
}

.home-avatar-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(255, 233, 183, 0.25) 0%, rgba(255, 233, 183, 0.08) 50%, transparent 70%);
  pointer-events: none;
}

.home-avatar-area canvas {
  position: relative;
  width: 240px;
  height: 340px;
  z-index: 1;
}

/* Greeting */
.home-greeting {
  text-align: center;
  z-index: 2;
  margin-top: 8px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.home-greeting-main {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 500;
  color: #E8DFD0;
  margin-bottom: 0;
  line-height: 1.25;
}

.home-greeting-sub {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #909FB4;
  margin-top: 4px;
}

/* Talk button */
.home-talk-area {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 24px;
  z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.home-talk-glow {
  position: absolute;
  width: 240px;
  height: 100px;
  border-radius: 9999px;
  background: radial-gradient(ellipse, rgba(255, 233, 183, 0.35) 0%, rgba(200, 169, 126, 0.1) 50%, transparent 70%);
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.home-talk-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 20px 48px;
  background: linear-gradient(135deg, #E8DFD0, #F0D0A0);
  border: none;
  border-radius: 9999px;
  color: #3A3828;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 25px rgba(200, 169, 126, 0.2);
  z-index: 1;
}

.home-talk-btn:active {
  transform: scale(0.95);
  transition: transform 0.15s ease-in-out;
}

.home-talk-btn svg {
  width: 14px;
  height: 19px;
  color: #3A3828;
}

/* Home → Conversation transition */
.home-fade-out {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.home-glow-rise {
  transform: translateY(-60px) scale(0.7);
  opacity: 0.5;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.4s ease;
}

/* ── Auth Mode (hides tab bar) ── */
body.fullscreen-mode #tab-bar {
  display: none !important;
}

body.fullscreen-mode #app {
  padding-bottom: 0;
}

/* ── Auth Screens ── */
.screen-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 16px;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-header h1 {
  margin-top: 16px;
}

.auth-header p {
  margin-top: 4px;
}

.auth-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-field {
  height: 52px;
  padding: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field:focus {
  border-color: var(--border-strong);
}

.auth-error {
  color: var(--accent-mic);
  font-size: 14px;
  min-height: 20px;
  text-align: center;
}

.auth-success {
  color: var(--accent-green);
  font-size: 14px;
  min-height: 20px;
  text-align: center;
}

.auth-switch {
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.auth-link {
  color: var(--accent-gold);
  text-decoration: none;
}

/* ── Conversation Screen (Figma Premium) ── */
.screen-conversation {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  background: #0C0C1F;
  overflow: hidden;
  animation: none;
  touch-action: manipulation;
}

.screen-conversation .conv-header,
.screen-conversation .conv-avatar-area,
.screen-conversation .conv-dialogue,
.screen-conversation .conv-status-label {
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.screen-conversation .conv-input-field input {
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
}

/* Background blur decorations */
.conv-bg-blur {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
}

.conv-bg-blur-left {
  width: 234px;
  height: 354px;
  left: -39px;
  top: 177px;
  background: #10102C;
  filter: blur(60px);
  opacity: 0.3;
}

.conv-bg-blur-right {
  width: 156px;
  height: 265px;
  right: -20px;
  bottom: 88px;
  background: #1A1949;
  filter: blur(50px);
  opacity: 0.2;
}

/* Header */
.conv-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(88px + var(--safe-area-top));
  padding: calc(8px + var(--safe-area-top)) 32px 24px;
  flex-shrink: 0;
  z-index: 2;
}

.conv-close-btn {
  position: absolute;
  left: 32px;
  background: none;
  border: none;
  color: #909FB4;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.conv-timer {
  font-family: 'Manrope', sans-serif;
  font-weight: 300;
  font-size: 18px;
  color: #C8C6C3;
  letter-spacing: 0.45px;
}

/* Status label */
.conv-status-label {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #909FB4;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  min-height: 20px;
  opacity: 0.6;
  flex-shrink: 0;
  z-index: 2;
  transition: opacity 0.3s ease-in-out;
}

.conv-status-label:empty {
  opacity: 0;
}

/* Avatar area */
.conv-avatar-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  flex-shrink: 0;
  z-index: 2;
  margin-top: -10px;
}

.conv-avatar-glow {
  position: absolute;
  width: 344px;
  height: 344px;
  border-radius: 9999px;
  background: rgba(255, 233, 183, 0.3);
  filter: blur(30px);
  pointer-events: none;
}

.conv-avatar-area canvas {
  position: relative;
  width: 186px;
  height: 274px;
  z-index: 1;
}

/* Dialogue area */
.conv-dialogue {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 32px 0;
  z-index: 2;
  overflow-y: auto;
}

.conv-halo-text {
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: #C8C6C3;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 16px;
  max-height: 140px;
  overflow: hidden;
  transition: opacity 0.3s ease-in-out;
}

.conv-halo-text:empty {
  display: none;
}

.conv-error-text {
  color: var(--accent-mic);
  font-size: 18px;
}

.conv-user-area {
  width: 100%;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.conv-user-area.visible {
  opacity: 0.8;
}

.conv-user-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #6666AA;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  margin-bottom: 6px;
}

.conv-user-text {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-style: italic;
  color: #909FB4;
  text-align: center;
  line-height: 1.6;
}

/* Bottom controls */
.conv-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px var(--safe-area-bottom);
  background: linear-gradient(to top, #1C1C28 0%, #1C1C28 50%, rgba(28, 28, 40, 0) 100%);
  flex-shrink: 0;
  z-index: 3;
}

.conv-input-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.conv-input-field {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 0 21px;
  height: 54px;
}

.conv-input-field input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

.conv-input-field input::placeholder {
  color: #64748B;
}

/* Conversation mic button — gold glow style */
.conv-mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background: #F8E9D1;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 20px rgba(248, 233, 209, 0.25);
}

.conv-mic-btn:active {
  transform: scale(0.95);
  transition: transform 0.15s ease-in-out;
}

.conv-mic-btn svg {
  width: 24px;
  height: 24px;
  color: #1C1C28;
  position: relative;
  z-index: 1;
}

.conv-mic-btn.active::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 9999px;
  border: 2px solid rgba(248, 233, 209, 0.6);
  animation: conv-mic-pulse 1.5s ease-out infinite;
}

.conv-mic-btn.send-mode {
  background: #F8E9D1;
}

.conv-mic-btn.send-mode svg {
  width: 20px;
  height: 20px;
  color: #1C1C28;
}

@keyframes conv-mic-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── Journal Screen (Figma) ── */
.screen-journal {
  background: #0C0C1F;
  padding: calc(8px + var(--safe-area-top)) 32px calc(var(--tab-bar-height) + var(--safe-area-bottom));
  animation: none;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screen-journal::-webkit-scrollbar {
  display: none;
}

.j-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.j-header-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: #C8C6C3;
  letter-spacing: -0.5px;
}

.j-search-btn {
  background: none;
  border: none;
  color: #909FB4;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.j-title {
  font-family: 'Manrope', sans-serif;
  font-size: 36px;
  font-weight: 200 !important;
  color: #C8C6C3;
  line-height: 1.0;
  margin-bottom: 20px;
}

.j-entries {
  display: flex;
  flex-direction: column;
}

.j-entry {
  display: flex;
  gap: 20px;
  padding: 10px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(65, 65, 125, 0.2);
  -webkit-tap-highlight-color: transparent;
  animation: card-appear 0.3s ease-in-out backwards;
}

.j-entry:nth-child(1) { animation-delay: 0ms; }
.j-entry:nth-child(2) { animation-delay: 50ms; }
.j-entry:nth-child(3) { animation-delay: 100ms; }
.j-entry:nth-child(4) { animation-delay: 150ms; }
.j-entry:nth-child(5) { animation-delay: 200ms; }
.j-entry:nth-child(6) { animation-delay: 250ms; }

@keyframes card-appear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.j-entry:last-child {
  border-bottom: none;
}

.j-entry-dot {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 6px;
}

.j-entry-body {
  flex: 1;
  min-width: 0;
}

.j-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.j-entry-date {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #909FB4;
}

.j-entry-dur {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #909FB4;
}

.j-entry-summary {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #C8C6C3;
  line-height: 26px;
}

.j-empty {
  text-align: center;
  padding: 40px 0;
}

/* ── Entry Detail Screen (Figma) ── */
.screen-entry {
  position: relative;
  background: #0C0C1F;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: entry-expand 0.3s ease-in-out;
}

.screen-entry::-webkit-scrollbar { display: none; }

@keyframes entry-expand {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.e-bg-blur {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
}

.e-bg-blur-left {
  width: 195px;
  height: 195px;
  left: -39px;
  bottom: 0;
  background: rgba(26, 25, 73, 0.2);
  filter: blur(60px);
}

.e-bg-blur-right {
  width: 156px;
  height: 156px;
  right: -39px;
  top: 321px;
  background: rgba(35, 34, 106, 0.1);
  filter: blur(60px);
}

.e-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(40px + var(--safe-area-top)) 32px 16px;
  background: linear-gradient(to bottom, #0C0C1F 60%, rgba(12, 12, 31, 0));
  z-index: 3;
}

.e-back-btn {
  background: none;
  border: none;
  color: #909FB4;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.e-header-date {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #909FB4;
  letter-spacing: 0.35px;
}

.e-header-dur {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #909FB4;
  letter-spacing: 0.35px;
}

.e-content {
  position: relative;
  padding: 0 32px 96px;
  z-index: 1;
}

/* Mood orb */
.e-mood {
  display: flex;
  justify-content: center;
  padding: 0 0 24px;
}

.e-mood-orb {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  position: relative;
}

.e-mood-orb::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 9999px;
  background: inherit;
  filter: blur(6px);
  opacity: 0.4;
}

.e-mood-label {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #909FB4;
  letter-spacing: -0.35px;
  margin-bottom: 20px;
}

/* Sections */
.e-section {
  margin-bottom: 20px;
}

.e-section-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #A5A5E8;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.6;
  margin-bottom: 16px;
}

/* Summary */
.e-summary {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: #C8C6C3;
  line-height: 32px;
  letter-spacing: -0.5px;
}

/* Themes */
.e-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.e-theme {
  display: inline-flex;
  align-items: center;
  background: rgba(26, 25, 73, 0.6);
  border-left: 2px solid #A5A5E8;
  border-radius: 9999px;
  padding: 8px 16px 8px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #E5E3FF;
  letter-spacing: 0.3px;
}

/* Transcript */
.e-transcript {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.e-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: msg-fade-in 0.15s ease-in-out backwards;
}

.e-transcript > :nth-child(1) { animation-delay: 0ms; }
.e-transcript > :nth-child(2) { animation-delay: 50ms; }
.e-transcript > :nth-child(3) { animation-delay: 100ms; }
.e-transcript > :nth-child(4) { animation-delay: 150ms; }
.e-transcript > :nth-child(5) { animation-delay: 200ms; }
.e-transcript > :nth-child(6) { animation-delay: 250ms; }
.e-transcript > :nth-child(7) { animation-delay: 300ms; }
.e-transcript > :nth-child(8) { animation-delay: 350ms; }

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

.e-msg-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #909FB4;
  letter-spacing: 0.3px;
}

.e-msg-text {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 300;
  line-height: 29px;
}

p.e-msg-halo {
  color: #F0D0A0;
}

p.e-msg-you {
  color: #A5A5E8;
}

/* Delete */
.e-footer {
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.e-delete-btn {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #B95463;
  opacity: 0.6;
  letter-spacing: 0.3px;
  padding: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Bottom Sheet ── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background 0.3s ease;
}

.sheet-overlay.visible {
  background: rgba(0, 0, 0, 0.5);
}

.sheet-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px 32px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.sheet-overlay.visible .sheet-container {
  transform: translateY(0);
}

.sheet-icon {
  margin-bottom: 16px;
}

.sheet-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.sheet-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.sheet-btn-keep {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  cursor: pointer;
  margin-bottom: 12px;
  -webkit-tap-highlight-color: transparent;
}

.sheet-btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: transparent;
  color: #AA6666;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid #3A2A2A;
  border-radius: var(--radius-button);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Fade Out Animation ── */
.screen-entry.fade-out {
  animation: fade-out 0.3s ease forwards;
}

@keyframes fade-out {
  to { opacity: 0; transform: scale(0.96); }
}

/* ── Profile Screen (Figma) ── */
.screen-profile {
  background: #0C0C1F;
  padding: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: none;
}

.screen-profile::-webkit-scrollbar { display: none; }

.p-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + var(--safe-area-top)) 32px 24px;
}

.p-header-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: #C8C6C3;
  letter-spacing: -0.5px;
}

.p-settings-btn {
  background: none;
  border: none;
  color: #909FB4;
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
}

.p-content {
  padding: 0 24px calc(var(--tab-bar-height) + 32px);
}

/* Hero */
.p-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.p-hero-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-name {
  font-family: 'Manrope', sans-serif;
  font-size: 36px;
  font-weight: 200 !important;
  color: #C8C6C3;
  letter-spacing: -0.9px;
  margin-bottom: 0;
}

.p-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  background: rgba(240, 208, 160, 0.1);
  border: 1px solid rgba(240, 208, 160, 0.2);
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #F0D0A0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.p-hero-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
}

.p-orb {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
}

.p-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #909FB4;
  margin-bottom: 20px;
}

/* Stats grid */
.p-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.p-stat {
  background: rgba(26, 25, 73, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-stat-num {
  font-family: 'Manrope', sans-serif;
  font-size: 30px;
  font-weight: 300;
  color: #C8C6C3;
  line-height: 36px;
}

.p-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #909FB4;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

/* Sections */
.p-section {
  margin-bottom: 20px;
}

.p-section-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #909FB4;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

/* Mood dots */
.p-mood-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.p-mood-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
}

.p-mood-sub {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: rgba(144, 159, 180, 0.6);
}

/* Top themes */
.p-themes-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.p-theme-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(26, 25, 73, 0.6);
  border-left: 2px solid;
  border-radius: 9999px;
  padding: 8px 16px 8px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #E5E3FF;
}

/* Your Shift card */
.p-shift-card {
  position: relative;
  background: #10102C;
  border-left: 2px solid rgba(200, 198, 195, 0.4);
  border-radius: 16px;
  padding: 23px 24px 24px 26px;
  overflow: hidden;
}

.p-shift-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #A5A5E8;
  line-height: 23px;
}

/* Sign out */
.p-signout {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #B95463;
  opacity: 0.6;
  padding: 24px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Settings Screen (Figma) ── */
.screen-settings {
  background: #0C0C1F;
  padding: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: screen-slide-in 0.3s ease-in-out;
}

.screen-settings::-webkit-scrollbar { display: none; }

@keyframes screen-slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.s-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(40px + var(--safe-area-top)) 32px 24px;
}

.s-header-title {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: #C8C6C3;
  letter-spacing: -0.5px;
}

.s-header-spacer {
  width: 29px;
}

.s-content {
  padding: 0 24px calc(var(--tab-bar-height) + 32px);
}

.s-group {
  margin-bottom: 24px;
}

.s-group-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #909FB4;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-left: 2px;
}

.s-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(65, 65, 125, 0.15);
}

.s-row:last-child {
  border-bottom: none;
}

.s-row-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #C8C6C3;
}

.s-row-value {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #909FB4;
}

.s-row-chevron {
  font-size: 18px;
  color: #909FB4;
  margin-left: 4px;
}

.s-row-link {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.s-badge-premium {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(240, 208, 160, 0.1);
  border: 1px solid rgba(240, 208, 160, 0.2);
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #F0D0A0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.s-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.s-signout-btn {
  width: 100%;
  padding: 16px;
  background: rgba(26, 25, 73, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #C8C6C3;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.s-delete-btn {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #B95463;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.s-version {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(144, 159, 180, 0.4);
  margin-top: 24px;
  padding-bottom: 16px;
}

/* ── Language Screen ── */
.screen-language {
  background: #0C0C1F;
  padding: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  animation: screen-slide-in 0.3s ease-in-out;
}

.screen-language::-webkit-scrollbar { display: none; }

.lang-list {
  display: flex;
  flex-direction: column;
}

.lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(65, 65, 125, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.lang-row:active {
  background: rgba(26, 25, 73, 0.3);
}

.lang-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #C8C6C3;
}

.lang-native {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #909FB4;
}

.lang-check {
  font-size: 18px;
  color: #F0D0A0;
}

.lang-active {
  position: relative;
}

.lang-active .lang-name {
  color: #F0D0A0;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Keep essential state changes visible */
  .halo-glow { animation: none; }
  .tab svg { transition: none; }
}

/* ── Utility ── */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-label { color: var(--text-label); }
.text-legal { font-size: 11px; color: var(--text-muted); }
