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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #222831 0%, #393E46 100%);
  color: #EEEEEE;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
}

button {
  font-family: 'Outfit', sans-serif;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: transparent;
}

.header-logo {
  max-width: 300px;
  height: auto;
}

.header-tagline {
  color: white;
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.5px;
  margin-top: 12px;
}

/* Grounding Banner */
.grounding-banner {
  background: #fff9e6;
  border: 1px solid #f0e5c5;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.grounding-banner p {
  color: #6b5d3f;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  flex: 1;
  padding-right: 16px;
}

.banner-dismiss {
  padding: 6px 16px;
  background: #f0e5c5;
  color: #6b5d3f;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.banner-dismiss:hover {
  background: #e5d9b5;
}

.grounding-banner.hidden {
  display: none;
}

.panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* Page Views */
.page-view {
  background: #DFD0B8;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 900px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid #C9BCA8;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.page-header h2 {
  color: #2c2822;
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.page-description {
  color: #8b7d6f;
  font-size: 0.95rem;
  margin: 0;
}

.page-header-title {
  flex: 1;
}

.page-content {
  margin-top: 20px;
}

.panel {
  background: #DFD0B8;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.panel h2 {
  color: #2c2822;
  font-size: 1.4rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #C9BCA8;
}

.panel h3 {
  color: #2c2822;
  font-size: 1.1rem;
  margin-top: 20px;
  margin-bottom: 12px;
}

/* Persona Panel */
.persona-selector {
  margin-bottom: 20px;
}

.persona-selector label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #34495e;
}

.persona-selector select {
  width: 100%;
  padding: 10px;
  border: 1px solid #C9BCA8;
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
}

.persona-info {
  background: #E8DDD0;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.info-item {
  margin-bottom: 8px;
}

.info-item strong {
  color: #2c2822;
  margin-right: 6px;
}

.info-item span {
  color: #5a4f42;
}

.create-persona-form {
  border-top: 1px solid #C9BCA8;
  padding-top: 16px;
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #2c2822;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #C9BCA8;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #948979;
  box-shadow: 0 0 0 3px rgba(148, 137, 121, 0.15);
}

button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: #948979;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover {
  background: #7d7464;
}

button[type="submit"]:active {
  background: #6b6355;
}

/* Memory Panel */
#memories-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
  margin-bottom: 20px;
}

.memory-item {
  background: #E8DDD0;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid #948979;
}

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

.memory-category {
  display: inline-block;
  padding: 3px 10px;
  background: #948979;
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.memory-weight {
  color: #8b7d6f;
  font-size: 0.85rem;
}

.memory-text {
  color: #2c2822;
  margin-bottom: 8px;
  line-height: 1.5;
}

.memory-delete {
  padding: 4px 12px;
  background: #c85a54;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.memory-delete:hover {
  background: #b34842;
}

.memory-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.memory-edit {
  padding: 4px 12px;
  background: #7891a8;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.memory-edit:hover {
  background: #657d92;
}

/* Memory Editing */
.memory-editing {
  background: #fff;
  border-left: 3px solid #d4a574;
}

.memory-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.memory-edit-form .form-group {
  margin-bottom: 0;
}

.memory-edit-form label {
  font-size: 0.85rem;
  color: #2c2822;
  margin-bottom: 4px;
}

.memory-edit-form .edit-category,
.memory-edit-form .edit-text,
.memory-edit-form .edit-weight {
  width: 100%;
  padding: 8px;
  border: 1px solid #C9BCA8;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

.memory-edit-form .edit-text {
  resize: vertical;
  min-height: 60px;
}

.memory-edit-error {
  color: #c85a54;
  font-size: 0.85rem;
  padding: 6px;
  background: #f5ddd9;
  border-radius: 4px;
}

.memory-edit-actions {
  display: flex;
  gap: 8px;
}

.btn-save {
  padding: 6px 16px;
  background: #948979;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save:hover {
  background: #7d7464;
}

.btn-cancel {
  padding: 6px 16px;
  background: #a89a8a;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cancel:hover {
  background: #8b7d6f;
}

.memory-hint {
  margin: 16px 0;
  padding: 12px;
  background: #E8DDD0;
  border-left: 3px solid #948979;
  border-radius: 4px;
  font-size: 14px;
  color: #2c2822;
}

.memory-hint p {
  margin: 0;
  line-height: 1.6;
}

.memory-hint strong {
  color: #948979;
}

.add-memory-form {
  border-top: 1px solid #C9BCA8;
  padding-top: 16px;
}

/* Snapshots Section */
.snapshots-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #C9BCA8;
}

.snapshots-description {
  color: #8b7d6f;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.btn-create-snapshot {
  padding: 8px 16px;
  background: #948979;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 16px;
}

.btn-create-snapshot:hover {
  background: #7d7464;
}

#snapshots-list {
  max-height: 300px;
  overflow-y: auto;
}

.snapshot-item {
  background: #E8DDD0;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid #948979;
}

.snapshot-info {
  flex: 1;
}

.snapshot-name {
  color: #2c2822;
  font-weight: 500;
  margin-bottom: 4px;
}

.snapshot-date {
  color: #8b7d6f;
  font-size: 0.8rem;
}

.btn-restore-snapshot {
  padding: 6px 14px;
  background: #5a9279;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-restore-snapshot:hover {
  background: #4a7d64;
}

/* Settings Section */
.settings-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #C9BCA8;
}

.settings-description {
  color: #8b7d6f;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.settings-group {
  margin-bottom: 20px;
}

.settings-group h4 {
  color: #2c2822;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #2c2822;
}

.settings-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #C9BCA8;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  color: #2c2822;
  cursor: pointer;
  transition: border-color 0.2s;
}

.settings-select:hover {
  border-color: #948979;
}

.settings-select:focus {
  outline: none;
  border-color: #948979;
  box-shadow: 0 0 0 3px rgba(148, 137, 121, 0.15);
}

.slider-group {
  margin-bottom: 16px;
}

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

.slider-label span:first-child {
  font-size: 0.9rem;
  font-weight: 500;
  color: #2c2822;
}

.slider-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #948979;
  background: #E8DDD0;
  padding: 2px 8px;
  border-radius: 4px;
  min-width: 24px;
  text-align: center;
}

.settings-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #C9BCA8;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #948979;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.settings-slider::-webkit-slider-thumb:hover {
  background: #7d7464;
  transform: scale(1.1);
}

.settings-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #948979;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.settings-slider::-moz-range-thumb:hover {
  background: #7d7464;
  transform: scale(1.1);
}

.boundaries-group {
  margin-top: 16px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #948979;
}

.checkbox-group label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: normal;
  color: #2c2822;
  cursor: pointer;
}

.btn-save-settings {
  padding: 10px 20px;
  background: #948979;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 16px;
  width: 100%;
}

.btn-save-settings:hover {
  background: #7d7464;
}

.settings-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.settings-feedback.success {
  background: #d9ede3;
  color: #2f5a3f;
  border: 1px solid #b8d9c5;
}

.settings-feedback.error {
  background: #f5ddd9;
  color: #c85a54;
  border: 1px solid #e6c3be;
}

/* ===================== */
/* CONVERSATION ROOM */
/* ===================== */

.conversation-room {
  position: relative;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  background-color: #2c3e50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 200px);
}

/* Room Welcome Header */
.room-welcome {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 40px 40px;
  color: white;
}

.room-welcome h1 {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: white;
  line-height: 1.2;
}

.room-welcome .room-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.room-welcome .room-instruction {
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 12px;
}

/* Candle Flicker Effect - Layer 1 (Full Room Ambient Glow) */
.conversation-room::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,140,60,0.4) 0%, rgba(211,84,0,0.25) 25%, rgba(180,70,20,0.15) 50%, transparent 80%);
  animation: candle-flicker-main 3s ease-in-out infinite;
  pointer-events: none;
}

/* Candle Flicker Effect - Layer 2 (Full Room Secondary Glow) */
.conversation-room::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 45% 45%, rgba(255,160,80,0.35) 0%, rgba(220,100,40,0.2) 30%, rgba(180,80,30,0.1) 55%, transparent 75%);
  animation: candle-flicker-slow 5s ease-in-out infinite;
  pointer-events: none;
}

/* Candle Flicker Effect - Layer 3 (Full Room Accent Shimmer) */
.fog-layer-3 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 55% 55%, rgba(255,180,100,0.3) 0%, rgba(255,140,60,0.15) 20%, rgba(200,90,30,0.08) 45%, transparent 70%);
  animation: candle-shimmer 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Ensure content stays on top */
.conversation-room > *:not(.fog-layer-3) {
  position: relative;
  z-index: 1;
}

/* Candle Flicker Animations */

/* Main flicker - obvious brightness pulse with movement */
@keyframes candle-flicker-main {
  0%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  25% {
    opacity: 0.3;
    transform: translateY(-25px) scale(1.12);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-15px) scale(0.88);
  }
  75% {
    opacity: 0.4;
    transform: translateY(-20px) scale(1.08);
  }
}

/* Slow ambient pulse - dramatic depth changes */
@keyframes candle-flicker-slow {
  0%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  33% {
    opacity: 0.25;
    transform: translateY(-18px) scale(1.15);
  }
  66% {
    opacity: 0.6;
    transform: translateY(-10px) scale(0.85);
  }
}

/* Quick shimmer - dramatic flame dancing */
@keyframes candle-shimmer {
  0%, 100% {
    opacity: 0.7;
    transform: translateY(0) scale(1);
  }
  15% {
    opacity: 1;
    transform: translateY(-30px) scale(1.18);
  }
  35% {
    opacity: 0.3;
    transform: translateY(-12px) scale(0.9);
  }
  50% {
    opacity: 0.85;
    transform: translateY(-22px) scale(1.1);
  }
  70% {
    opacity: 0.4;
    transform: translateY(-8px) scale(0.95);
  }
  85% {
    opacity: 0.9;
    transform: translateY(-18px) scale(1.05);
  }
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: fadeIn 0.3s ease-in;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message.persona {
  align-self: flex-start;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
}

.chat-message.user .message-bubble {
  background: rgba(211, 84, 0, 0.3);
  color: white;
}

.chat-message.persona .message-bubble {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Input Container */
.chat-input-container {
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
}

#chat-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

#chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
}

#chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#chat-input:focus {
  outline: none;
  border-color: rgba(211, 84, 0, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

#chat-form button[type="submit"] {
  padding: 12px 24px;
  background: rgba(211, 84, 0, 0.8);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

#chat-form button[type="submit"]:hover {
  background: rgba(211, 84, 0, 1);
}

#chat-form button[type="submit"]:active {
  transform: scale(0.98);
}

/* Room Header */
.room-header {
  background: linear-gradient(135deg, #ffffff 0%, #faf8f6 100%);
  border-bottom: 2px solid #e8dfd6;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.room-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.persona-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a574 0%, #c8956a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.persona-avatar span {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.room-title-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-title {
  font-size: 1.3rem;
  color: #3d2f1f;
  margin: 0;
  padding: 0;
  border: none;
  font-weight: 600;
}

.room-subtitle {
  font-size: 0.85rem;
  color: #8b7355;
  margin: 0;
  font-style: italic;
}

.room-header-right {
  display: flex;
  align-items: center;
}

.room-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Text Size Control */
.text-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 0.85rem;
  color: #6b5d3f;
  font-weight: 500;
}

.segmented-control {
  display: flex;
  background: #ede4db;
  border-radius: 6px;
  overflow: hidden;
}

.segment-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  background: transparent;
  border: none;
  color: #6b5d3f;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.segment-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.segment-btn.active {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Voice Control Toggle */
.voice-control {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #6b5d3f;
}

.toggle-label input {
  display: none;
}

.toggle-slider {
  width: 40px;
  height: 22px;
  background: #ddd;
  border-radius: 11px;
  position: relative;
  transition: background 0.3s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-slider {
  background: #d4a574;
}

.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.toggle-text {
  font-weight: 500;
}

/* Messages Container */
.messages-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #393E46;
  border-radius: 12px;
  margin: 20px;
  min-height: 400px;
  max-height: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #EEEEEE;
  font-style: italic;
}

.empty-state p {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* Incomplete Setup State */
.incomplete-setup-state {
  text-align: center;
  padding: 40px 20px;
}

.incomplete-setup-state p {
  color: #EEEEEE;
  margin-bottom: 20px;
  line-height: 1.6;
}

.btn-continue-setup {
  padding: 10px 24px;
  background: #d4a574;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-continue-setup:hover {
  background: #c8956a;
}

/* Pre-roll First Message */
.pre-roll-message {
  text-align: center;
  padding: 40px 20px;
  animation: fadeIn 0.5s ease-in;
}

.pre-roll-message p {
  color: #8b7355;
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 16px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: #d4a574;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Messages */
.message {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  animation: fadeInMessage 0.4s ease-in;
}

@keyframes fadeInMessage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-items: flex-end;
}

.message.persona {
  align-items: flex-start;
}

.message-header {
  font-size: 0.8rem;
  color: #9b8670;
  margin-bottom: 6px;
  font-weight: 600;
}

.message-bubble {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.7;
  word-wrap: break-word;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #d4a574 0%, #c8956a 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(212, 165, 116, 0.3);
}

.message.persona .message-bubble {
  background: white;
  color: #3d2f1f;
  border: 1px solid #e8dfd6;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* First message special styling */
.message.persona.first-message .message-bubble {
  background: linear-gradient(135deg, #fffbf7 0%, #fff8f2 100%);
  border: 2px solid #e8dfd6;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.message-grounding {
  font-size: 0.75rem;
  color: #b8a89a;
  font-style: italic;
  margin-top: 6px;
  max-width: 75%;
  line-height: 1.4;
}

/* Text Size Large */
.conversation-room.text-size-large .message-bubble {
  font-size: 1.15rem;
  line-height: 1.8;
  padding: 16px 20px;
}

.conversation-room.text-size-large .message-grounding {
  font-size: 0.85rem;
}

/* Healthy Use Nudge */
.healthy-use-nudge {
  background: #e8f4f8;
  border: 1px solid #b8dce8;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 24px;
}

.healthy-use-nudge p {
  color: #34495e;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

/* Strict Mode Elements */
.strict-mode-link {
  display: block;
  font-size: 0.75rem;
  color: #b8a89a;
  text-decoration: none;
  margin-top: 6px;
  max-width: 75%;
  cursor: pointer;
}

.strict-mode-link:hover {
  color: #9b8670;
  text-decoration: underline;
}

.strict-mode-indicator {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strict-mode-text {
  color: #856404;
  font-size: 0.85rem;
  font-weight: 600;
}

.strict-mode-indicator a {
  color: #856404;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.strict-mode-indicator a:hover {
  text-decoration: underline;
}

.strict-mode-notice {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  color: #155724;
  font-size: 0.85rem;
  animation: fadeInOut 4s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

/* Room Footer */
.room-footer {
  background: linear-gradient(135deg, #ffffff 0%, #faf8f6 100%);
  border-top: 2px solid #e8dfd6;
  padding: 20px 24px;
  position: relative;
  z-index: 1;
}

.optional-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.optional-control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.optional-control-item label {
  font-size: 0.8rem;
  color: #9b8670;
  font-weight: 500;
  white-space: nowrap;
}

.optional-control-item select {
  padding: 6px 10px;
  font-size: 0.85rem;
  border: 1px solid #e8dfd6;
  border-radius: 6px;
  background: white;
  color: #3d2f1f;
  cursor: pointer;
  transition: border-color 0.2s;
}

.optional-control-item select:hover {
  border-color: #d4a574;
}

.optional-control-item select:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.1);
}

.main-input-area {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.main-input-area input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #e8dfd6;
  border-radius: 12px;
  background: white;
  color: #3d2f1f;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.main-input-area input[type="text"]:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.main-input-area input[type="text"]::placeholder {
  color: #b8a89a;
}

.send-btn {
  padding: 12px 28px;
  background: #948979;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(148, 137, 121, 0.3);
  white-space: nowrap;
}

.send-btn:hover {
  background: #7d7464;
  box-shadow: 0 3px 8px rgba(148, 137, 121, 0.4);
  transform: translateY(-1px);
}

.send-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(148, 137, 121, 0.3);
}

.send-btn:disabled {
  background: #ddd;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ===================== */
/* JOURNAL PANEL */
/* ===================== */

.journal-panel {
  display: flex;
  flex-direction: column;
}

#journal-entries-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  max-height: 400px;
}

.journal-entry {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}

.journal-entry:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-color: #3498db;
}

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

.journal-entry-date {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
}

.journal-mood-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.journal-entry-text {
  color: #2c3e50;
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.journal-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.journal-tag-badge {
  display: inline-block;
  background: #f1f3f5;
  color: #495057;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
}

.journal-reflection {
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  padding: 12px;
  margin-top: 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #856404;
  line-height: 1.5;
}

.journal-reflection em {
  font-weight: 600;
  font-style: normal;
  margin-right: 5px;
}

.journal-entry-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
}

.btn-delete-journal {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-journal:hover {
  background: #c82333;
}

.add-journal-form {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-top: 15px;
}

.add-journal-form h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #2c3e50;
}

.add-journal-form .checkbox-item {
  margin: 15px 0;
}

/* Top Bar and Hamburger Menu */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: transparent;
  padding: 12px 20px;
  border-bottom: none;
}

.hamburger-menu {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.3s;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background: #EEEEEE;
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger-menu:hover span {
  background: #FFFFFF;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: -320px;
  top: 0;
  width: 320px;
  height: 100vh;
  background: #DFD0B8;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  transition: left 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #C9BCA8;
  background: linear-gradient(135deg, #E8DDD0 0%, #DFD0B8 100%);
}

.sidebar-header h3 {
  margin: 0;
  color: #2c2822;
  font-size: 1.3rem;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #8b7d6f;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-close:hover {
  color: #2c2822;
  transform: rotate(90deg);
}

.sidebar-content {
  padding: 20px;
}

/* Sidebar Navigation */
.sidebar-nav {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #C9BCA8;
}

.nav-link {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #5a4f42;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-link:hover {
  background: #E8DDD0;
  color: #948979;
  transform: translateX(4px);
}

.nav-link.active {
  background: #948979;
  color: white;
}

.nav-link.active:hover {
  background: #7d7464;
  transform: translateX(0);
}

.sidebar-section {
  margin-bottom: 30px;
}

.sidebar-section h4 {
  color: #2c2822;
  font-size: 1.1rem;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #948979;
}

.sidebar-section .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.sidebar-section .panel-header h4 {
  margin: 0;
  padding: 0;
  border-bottom: none;
}

.btn-sidebar-secondary {
  padding: 6px 12px;
  font-size: 0.85rem;
  background: white;
  color: #948979;
  border: 1px solid #948979;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sidebar-secondary:hover {
  background: #948979;
  color: white;
}

.sidebar-section .add-memory-form h3 {
  color: #2c3e50;
  font-size: 1rem;
  margin: 20px 0 15px 0;
}

.sidebar-section .memory-hint {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #5a6c7d;
}

.sidebar-section .memory-hint p {
  margin: 0;
}

.sidebar-section .feature-explanation {
  background: linear-gradient(135deg, #f0f4f8 0%, #e8f0f7 100%);
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 3px solid #3498db;
  font-size: 0.9rem;
  color: #34495e;
  line-height: 1.6;
}

.sidebar-section .feature-explanation p {
  margin: 0 0 10px 0;
}

.sidebar-section .feature-explanation p:last-child {
  margin-bottom: 0;
}

.sidebar-section .feature-explanation ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.sidebar-section .feature-explanation li {
  margin-bottom: 6px;
}

.sidebar-section .add-journal-form h3 {
  color: #2c3e50;
  font-size: 1rem;
  margin: 20px 0 15px 0;
}

.sidebar-section-content {
  padding: 10px 0;
}

.sidebar-section .persona-selector {
  margin-bottom: 15px;
}

.sidebar-section .persona-selector select {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sidebar-section .persona-selector select:hover {
  border-color: #3498db;
}

.sidebar-section .persona-selector select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.sidebar-section .continue-setup-container {
  margin-top: 15px;
}

.sidebar-section .btn-continue-setup {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #d4a574 0%, #c8956a 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.sidebar-section .btn-continue-setup:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
}

.sidebar-section .setup-hint {
  font-size: 0.85rem;
  color: #718096;
  margin: 0;
  text-align: center;
  font-style: italic;
}

.persona-status {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.status-label {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin: 0 0 5px 0;
}

.status-value {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.status-completion {
  font-size: 0.9rem;
  color: #8b7355;
  margin: 0;
  font-style: italic;
}

.btn-sidebar-action {
  width: 100%;
  background: linear-gradient(135deg, #d4a574 0%, #c8956a 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sidebar-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(212, 165, 116, 0.3);
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none; /* Don't block clicks when hidden */
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Enable clicks when visible */
}

/* Responsive */
@media (max-width: 1024px) {
  .panels {
    grid-template-columns: 1fr;
  }

  .panel {
    max-height: none;
  }

  #memories-list,
  .chat-messages {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  .panel h2 {
    font-size: 1.2rem;
  }

  .chat-controls {
    grid-template-columns: 1fr;
  }

  .chat-input-wrapper {
    flex-direction: column;
  }

  .chat-input-wrapper button {
    width: 100%;
  }
}

/* Panel Header */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.panel-header h2 {
  margin: 0;
}

.btn-secondary {
  background: #8b7d6f;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: #756a5d;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #C9BCA8;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #2c2822;
}

.wizard-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  line-height: 1.3;
  max-width: 400px;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #8b7d6f;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: #E8DDD0;
  color: #2c2822;
}

.modal-body {
  padding: 20px;
}

.modal-description {
  color: #8b7d6f;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Continue Setup Section */
.continue-setup-container {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  text-align: center;
  border: 2px solid #d4a574;
}

.btn-continue-setup {
  background: linear-gradient(135deg, #d4a574 0%, #c8956a 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 8px;
}

.btn-continue-setup:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.setup-hint {
  color: #8b7355;
  font-size: 0.85rem;
  margin: 0;
  font-style: italic;
}

/* Wizard Section */
.wizard-section {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  text-align: center;
}

.btn-setup-wizard {
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 8px;
}

.btn-setup-wizard:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(148, 137, 121, 0.4);
}

.wizard-hint {
  color: #8b7d6f;
  font-size: 0.85rem;
  margin: 0;
}

/* Wizard Modal */
.wizard-modal {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.wizard-modal.visible {
  opacity: 1;
}

.wizard-modal .modal-content {
  max-width: 700px;
  animation: gentleSlideIn 1s ease-out;
}

@keyframes gentleSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wizard-content {
  max-height: 85vh;
}

.wizard-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-voice-btn {
  background: none;
  border: 2px solid #948979;
  color: #948979;
  cursor: pointer;
  padding: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.wizard-voice-btn:hover {
  background: #f5f0ea;
  border-color: #7d7464;
  color: #7d7464;
}

.wizard-voice-btn.recording {
  background: #c85a54;
  border-color: #c85a54;
  color: white;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.step-question {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c2822;
  margin-bottom: 20px;
  line-height: 1.4;
}

.wizard-text-input {
  height: 48px;
  padding: 12px 16px;
  font-size: 1rem;
}

.voice-confirmation {
  margin-top: 24px;
  padding: 20px;
  background: #E8DDD0;
  border-radius: 8px;
  border: 1px solid #C9BCA8;
}

.voice-confirmation-text {
  font-size: 1rem;
  color: #2c2822;
  margin-bottom: 8px;
}

.voice-confirmation-text strong {
  color: #948979;
  font-weight: 600;
}

.voice-confirmation-prompt {
  font-size: 0.9rem;
  color: #8b7d6f;
  margin-bottom: 12px;
}

.voice-confirmation-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-confirm-name,
.btn-use-correction {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-confirm-name {
  background: #948979;
  color: white;
}

.btn-confirm-name:hover {
  background: #7d7464;
}

.btn-use-correction {
  background: white;
  color: #2c2822;
  border: 1px solid #C9BCA8;
}

.btn-use-correction:hover {
  background: #f5f0ea;
}

/* Wizard step fade-in animation */
[id^="wizard-step-"] {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

[id^="wizard-step-"].active {
  opacity: 1;
}

.wizard-step-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wizard-welcome-main,
.wizard-welcome-more {
  width: 100%;
  max-width: 550px;
}

.wizard-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin: 32px auto 0;
}

.btn-wizard-primary {
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(148, 137, 121, 0.3);
}

.btn-wizard-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(148, 137, 121, 0.4);
}

.btn-wizard-primary:active {
  transform: translateY(0);
}

.btn-wizard-continue {
  background: linear-gradient(135deg, #c9a962 0%, #a88b4a 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(201, 169, 98, 0.3);
}

.btn-wizard-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 169, 98, 0.4);
}

.btn-wizard-continue:active {
  transform: translateY(0);
}

.btn-wizard-secondary {
  background: transparent;
  color: #8b7d6f;
  border: 1px solid #C9BCA8;
  padding: 16px 32px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-wizard-secondary:hover {
  background: #f5f0ea;
  border-color: #a89a8a;
  color: #5a4f42;
}

.btn-wizard-secondary:active {
  background: #E8DDD0;
}

.wizard-progress {
  padding: 20px;
  border-bottom: 1px solid #C9BCA8;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #C9BCA8;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #948979 0%, #7d7464 100%);
  transition: width 0.3s ease;
  width: 16.66%;
}

.progress-text {
  text-align: center;
  color: #8b7d6f;
  font-size: 0.9rem;
  margin: 0;
}

.wizard-step {
  min-height: 300px;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.wizard-step.active {
  opacity: 1;
}

.wizard-step h3 {
  color: #2c2822;
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
}

.step-description {
  color: #8b7d6f;
  margin-bottom: 20px;
  font-size: 1.05rem;
  font-style: italic;
}

.step-intro {
  color: #5a6c7d;
  background: #f8f9fa;
  padding: 16px;
  border-left: 3px solid #d4a574;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.step-acknowledgment {
  color: #8b7355;
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #fffbf7;
  border-left: 2px solid #d4a574;
  border-radius: 3px;
  /* Hide static acknowledgments - AI generates personalized ones now */
  display: none !important;
}

.slider-helper {
  color: #95a5a6;
  font-size: 0.85rem;
  margin: 4px 0 8px 0;
  font-style: italic;
}

.wizard-step textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

.wizard-summary {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.wizard-summary ul {
  margin: 10px 0 0 20px;
  color: #2c3e50;
}

.wizard-summary li {
  margin: 8px 0;
}

.wizard-loading {
  text-align: center;
  padding: 30px;
  color: #667eea;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 20px auto;
  border: 4px solid #e0e0e0;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.wizard-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  padding-bottom: 80px; /* Space for bottom tab bar on mobile */
  border-top: 1px solid #e0e0e0;
}

/* On desktop, remove extra bottom padding */
@media (min-width: 769px) {
  .wizard-navigation {
    padding-bottom: 0;
  }
}

.nav-spacer {
  flex: 1;
}

#wizard-next, #wizard-generate {
  background: #948979;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
}

#wizard-next:hover, #wizard-generate:hover {
  background: #7d7464;
}

#wizard-generate {
  background: #5a9279;
}

#wizard-generate:hover {
  background: #4a7d64;
}

/* ========================================
   BREATHING EXERCISE & ACKNOWLEDGMENT SCREENS
   ======================================== */

/* Breathing Exercise Screen */
.wizard-breathing-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 40px 20px;
  padding-bottom: 100px; /* Extra space for mobile bottom tab bar */
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.wizard-breathing-screen.visible {
  opacity: 1;
}

@media (min-width: 769px) {
  .wizard-breathing-screen {
    padding-bottom: 40px;
  }
}

.breathing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  max-width: 500px;
  margin: 0 auto;
}

.breathing-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c2822;
  margin: 0;
  font-family: 'Outfit', sans-serif;
}

.breathing-instruction {
  font-size: 1.3rem;
  font-weight: 500;
  color: #948979;
  margin: 0;
  min-height: 30px;
  transition: opacity 0.5s ease;
}

.breathing-circle-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  box-shadow: 0 8px 32px rgba(148, 137, 121, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Animation will be applied via JavaScript for better control */
}

.breathing-circle-inner {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
}

.breathing-subtitle {
  font-size: 1rem;
  color: #8b7d6f;
  margin: 0;
  font-style: italic;
}

.btn-skip-breathing {
  margin-top: 40px;
  background: transparent;
  border: 1px solid #C9BCA8;
  color: #8b7d6f;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-skip-breathing:hover {
  background: #f5f0ea;
  border-color: #a89a8a;
  color: #5a4f42;
}

/* Breathing animations - controlled by JavaScript */
@keyframes breathe-in {
  from {
    transform: scale(0.7);
    opacity: 0.6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes breathe-hold {
  from, to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes breathe-out {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.7);
    opacity: 0.6;
  }
}

.breathing-circle.inhale {
  animation: breathe-in 4s ease-in-out forwards;
}

.breathing-circle.hold {
  animation: breathe-hold 2s ease-in-out forwards;
}

.breathing-circle.exhale {
  animation: breathe-out 6s ease-in-out forwards;
}

/* AI Acknowledgment Screen */
.wizard-acknowledgment-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 40px 20px;
  padding-bottom: 100px; /* Extra space for mobile bottom tab bar */
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.wizard-acknowledgment-screen.visible {
  opacity: 1;
}

@media (min-width: 769px) {
  .wizard-acknowledgment-screen {
    padding-bottom: 40px;
  }
}

.acknowledgment-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background: #E8DDD0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.acknowledgment-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(148, 137, 121, 0.4);
  animation: fadeInScale 0.6s ease-out forwards;
}

.acknowledgment-icon svg {
  width: 32px;
  height: 32px;
}

.acknowledgment-text {
  font-size: 1.2rem;
  line-height: 1.7;
  color: #2c2822;
  margin: 0;
  font-weight: 400;
  text-align: left;
  width: 100%;
}

/* Typing animation effect */
.acknowledgment-text.typing {
  overflow: hidden;
  border-right: 2px solid #948979;
  white-space: nowrap;
  animation: blink-caret 0.75s step-end infinite;
}

/* Acknowledgment Continue Button */
.btn-acknowledgment-continue {
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  border: none;
  padding: 14px 40px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(148, 137, 121, 0.3);
  margin-top: 15px;
  animation: fadeInUp 0.4s ease-out forwards;
}

.btn-acknowledgment-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(148, 137, 121, 0.4);
}

.btn-acknowledgment-continue:active {
  transform: translateY(0);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: #948979;
  }
}

/* Voice Recording */
.memory-text-wrapper {
  position: relative;
}

.voice-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  background: white;
  border: 1px solid #C9BCA8;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  color: #948979;
}

.voice-btn:hover {
  background: #f5f0ea;
  border-color: #948979;
  transform: scale(1.05);
}

.voice-btn.recording {
  background: #c85a54;
  border-color: #c85a54;
  color: white;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.voice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.voice-status {
  font-size: 0.85rem;
  color: #948979;
  margin-top: 5px;
  font-style: italic;
}

.voice-status.error {
  color: #c85a54;
}

.voice-status.success {
  color: #5a9279;
}

/* Boost Persona Section */
.boost-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.btn-boost-persona {
  background: linear-gradient(135deg, #d4a574 0%, #c8956a 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  margin-bottom: 8px;
}

.btn-boost-persona:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.boost-hint {
  color: #8b7d6f;
  font-size: 0.85rem;
  margin: 0;
  text-align: center;
}

/* Boost Modal */
.boost-modal .modal-content {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.boost-loading {
  text-align: center;
  padding: 40px;
  color: #948979;
}

.boost-results .boost-section {
  margin-bottom: 30px;
}

.boost-section h3 {
  color: #2c2822;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* Missing Categories */
#missing-categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tag {
  background: #E8DDD0;
  border: 1px solid #C9BCA8;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.9rem;
  color: #5a4f42;
}

.category-tag.empty {
  opacity: 0.6;
  font-style: italic;
}

/* Suggested Memories */
#suggested-memories-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.suggested-memory-card {
  background: #E8DDD0;
  border: 1px solid #C9BCA8;
  border-radius: 8px;
  padding: 15px;
}

.memory-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.memory-card-category {
  background: #948979;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.memory-card-weight {
  color: #8b7d6f;
  font-size: 0.85rem;
}

.memory-card-text {
  color: #2c2822;
  margin: 10px 0;
  line-height: 1.5;
}

.btn-add-suggested {
  background: #5a9279;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-add-suggested:hover {
  background: #4a7d64;
}

.btn-add-suggested.added {
  background: #8b7d6f;
  cursor: not-allowed;
}

/* Tone Suggestions */
#tone-suggestions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.tone-comparison {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #E8DDD0;
  padding: 10px;
  border-radius: 6px;
}

.tone-comparison-label {
  font-weight: 500;
  color: #2c2822;
  min-width: 120px;
}

.tone-comparison-values {
  display: flex;
  gap: 20px;
  align-items: center;
}

.tone-value {
  font-size: 0.9rem;
  color: #8b7d6f;
}

.tone-value.current {
  color: #5a4f42;
}

.tone-value.suggested {
  color: #d4a574;
  font-weight: 600;
}

.btn-apply-tone {
  background: #948979;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-apply-tone:hover {
  background: #7d7464;
}

/* Boundary Flags */
#boundary-flags-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boundary-flag {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 12px 15px;
  border-radius: 4px;
  color: #856404;
  font-size: 0.9rem;
}

.boost-actions {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

/* ===================================
   Step Zero Welcome Modal
   =================================== */

.step-zero-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.step-zero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.step-zero-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 650px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: stepZeroFadeIn 0.4s ease-out;
  padding: 50px 40px;
}

@keyframes stepZeroFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.step-zero-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-zero-title {
  color: #2c2822;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 30px;
  line-height: 1.3;
}

.step-zero-body {
  color: #5a4f42;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 550px;
}

.step-zero-body p {
  margin-bottom: 20px;
}

.step-zero-body p:last-child {
  margin-bottom: 0;
}

.step-zero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
}

.btn-step-zero-primary {
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(148, 137, 121, 0.3);
}

.btn-step-zero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(148, 137, 121, 0.4);
}

.btn-step-zero-primary:active {
  transform: translateY(0);
}

.btn-step-zero-secondary {
  background: transparent;
  color: #8b7d6f;
  border: 1px solid #C9BCA8;
  padding: 14px 32px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-step-zero-secondary:hover {
  background: #f5f0ea;
  border-color: #a89a8a;
  color: #5a4f42;
}

.btn-step-zero-secondary:active {
  background: #E8DDD0;
}

/* "I Need More Time" Banner */
.need-time-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
  border-top: 2px solid #cbd5e0;
  padding: 20px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.need-time-banner p {
  color: #4a5568;
  font-size: 1rem;
  margin: 0;
  flex: 0 1 auto;
}

.btn-start-everspeak {
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(148, 137, 121, 0.3);
  white-space: nowrap;
}

.btn-start-everspeak:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(148, 137, 121, 0.4);
}

.btn-start-everspeak:active {
  transform: translateY(0);
}

.btn-close-time-banner {
  background: transparent;
  border: none;
  color: #a0aec0;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.btn-close-time-banner:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #4a5568;
}

/* Responsive adjustments for Step Zero */
@media (max-width: 768px) {
  .step-zero-content {
    padding: 40px 30px;
  }
  
  .step-zero-title {
    font-size: 1.6rem;
  }
  
  .step-zero-body {
    font-size: 1rem;
  }
  
  .need-time-banner {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 16px;
  }
  
  .need-time-banner p {
    font-size: 0.9rem;
  }
}

/* First Conversation Banner */
.first-conversation-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
  border-top: 2px solid #cbd5e0;
  padding: 20px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  animation: slideUp 0.5s ease-out;
}

.first-conversation-banner p {
  color: #4a5568;
  font-size: 1rem;
  margin: 0;
  flex: 0 1 auto;
}

.btn-begin-conversation {
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(148, 137, 121, 0.3);
}

.btn-begin-conversation:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(148, 137, 121, 0.4);
}

.btn-close-conversation-banner {
  background: transparent;
  border: none;
  color: #718096;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 8px 12px;
  line-height: 1;
  transition: color 0.2s ease;
  flex-shrink: 0;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-conversation-banner:hover {
  color: #4a5568;
}

/* Skip Button in Wizard */
.btn-skip-step {
  background: transparent;
  color: #718096;
  border: 1px solid #cbd5e0;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.3s ease;
}

.btn-skip-step:hover {
  background: #f7fafc;
  border-color: #a0aec0;
  color: #4a5568;
}

.skip-caption {
  color: #718096;
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 12px;
  line-height: 1.5;
}

.wizard-transition-summary {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #f9f6f3 0%, #f5f0eb 100%);
  border-radius: 8px;
  border-left: 3px solid #d4a574;
}

.transition-text {
  font-size: 0.9rem;
  color: #6b5d3f;
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

.wizard-progress-container {
  margin-top: 28px;
  text-align: center;
}

.wizard-progress-text {
  font-size: 0.95rem;
  color: #6b5d3f;
  margin-bottom: 12px;
  font-style: italic;
}

.wizard-progress-bar {
  width: 100%;
  height: 8px;
  background: #e8e4df;
  border-radius: 4px;
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a574 0%, #c8956a 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.btn-wizard-begin {
  margin-top: 28px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #d4a574 0%, #c8956a 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
}

.btn-wizard-begin:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.btn-wizard-begin:active {
  transform: translateY(0);
}

/* Transition Screen Styling */
.transition-content {
  text-align: center;
  padding: 20px 0;
}

.transition-content h3 {
  color: #2d3748;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.transition-content .step-description {
  color: #4a5568;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.transition-info {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
  text-align: left;
}

.transition-info p {
  color: #2d3748;
  font-weight: 600;
  margin-bottom: 12px;
}

.transition-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.transition-info li {
  color: #4a5568;
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
}

.transition-info li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
}

.transition-question {
  color: #2d3748;
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 16px;
}

/* Memory Hint Styling */
.memory-hint {
  background: #f7fafc;
  border-left: 3px solid #667eea;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.5;
}

.memory-hint strong {
  color: #2d3748;
}

@media (max-width: 768px) {
  .first-conversation-banner {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 16px;
  }
  
  .first-conversation-banner p {
    font-size: 0.9rem;
  }
  
  .transition-content h3 {
    font-size: 1.3rem;
  }
  
  .transition-info {
    padding: 16px;
  }
}

/* ========================================
   HOME PAGE
   ======================================== */

.home-welcome {
  max-width: 600px;
  margin: 60px auto;
  padding: 40px 20px;
  text-align: center;
}

.home-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 12px;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
}

.home-subtitle {
  font-size: 1.1rem;
  color: #948979;
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.home-description {
  font-size: 1rem;
  line-height: 1.7;
  color: #8b7d6f;
  margin-bottom: 40px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.btn-home-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #948979 0%, #7d7464 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(148, 137, 121, 0.3);
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}

.btn-home-primary .btn-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.btn-home-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(148, 137, 121, 0.4);
}

.btn-home-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(148, 137, 121, 0.3);
}

.home-helper-text {
  font-size: 0.9rem;
  color: #8b7d6f;
  margin-top: 8px;
}

.home-helper-text strong {
  color: #948979;
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .home-welcome {
    margin: 40px auto;
    padding: 30px 20px;
  }

  .home-title {
    font-size: 2rem;
  }

  .home-subtitle {
    font-size: 1rem;
  }

  .home-description {
    font-size: 0.95rem;
  }

  .btn-home-primary {
    width: 100%;
    max-width: 320px;
  }
}

/* ========================================
   MOBILE SETTINGS BUTTON (Personas Page)
   ======================================== */

.btn-settings-mobile,
.btn-back-mobile {
  display: none; /* Hidden by default (desktop) */
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #948979; /* Sage color */
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.btn-settings-mobile svg,
.btn-back-mobile svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.btn-settings-mobile:active,
.btn-back-mobile:active {
  transform: scale(0.9);
  background: rgba(148, 137, 121, 0.1);
}

/* Update page header to flex layout */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.page-header-content {
  flex: 1;
}

/* Show settings and back buttons only on mobile */
@media (max-width: 768px) {
  .btn-settings-mobile,
  .btn-back-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ========================================
   BOTTOM TAB BAR (Mobile Navigation)
   ======================================== */

.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #DFD0B8; /* Cream background */
  border-top: 1px solid #C9BCA8; /* Dark cream border */
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom)); /* iOS safe area */
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  transform: translateY(0);
  opacity: 1;
}

.bottom-tab-bar.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #8b7d6f; /* Muted brown - inactive */
  padding: 6px 12px;
  min-height: 56px; /* 44px+ for touch target */
  min-width: 60px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
  flex: 1;
  max-width: 100px;
}

.tab-item:active {
  transform: scale(0.95);
}

.tab-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.tab-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

/* Active tab state */
.tab-item.active {
  color: #948979; /* Sage - active */
}

.tab-item.active .tab-icon {
  stroke-width: 2.5;
  transform: translateY(-2px);
}

.tab-item.active .tab-label {
  font-weight: 600;
  color: #7d7464; /* Darker sage */
}

/* Hover state (desktop) */
@media (hover: hover) {
  .tab-item:hover {
    color: #948979;
  }

  .tab-item:hover .tab-icon {
    transform: translateY(-2px);
  }
}

/* Hide bottom tab bar on desktop, show hamburger instead */
@media (min-width: 769px) {
  .bottom-tab-bar {
    display: none;
  }
}

/* Show bottom tab bar on mobile, adjust page layout */
@media (max-width: 768px) {
  .bottom-tab-bar {
    display: flex;
  }

  /* Add padding to bottom of main content to prevent tab bar overlap */
  .panels {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  /* Adjust conversation room for tab bar */
  .conversation-room {
    padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
  }

  /* Hide hamburger menu on mobile (use tabs instead) */
  .top-bar {
    display: none;
  }

  /* Hide sidebar on mobile (tabs replace it) */
  .sidebar,
  .sidebar-overlay {
    display: none !important;
  }
}
