/* LYFE Brand Palette
   --cream:      #fde0a6
   --sand:       #d8b98c
   --brown:      #88613f  (primary headings)
   --gold-light: #d9af62
   --gold:       #bf6e26
   --rust:       #8c441b
   --teal:       #377989
   --teal-dark:  #bf6e26  (nav/footer)
   --blue-grey:  #c1d4d9
   --orange:     #ee9444
*/

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

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  background: #faf7f2;
  color: #3a2a1a;
  line-height: 1.6;
}

/* ── Nav ── */
nav {
  background: #bf6e26;
  color: #c1d4d9;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .brand {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fde0a6;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-script {
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
  color: #ffffff;
}

nav .nav-links a {
  color: #ffffff;
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.9rem;
  font-family: Arial, sans-serif;
}

nav .nav-links a:hover { color: #fde0a6; }

/* ── Layout ── */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Page headings ── */
h1 {
  color: #88613f;
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #bf6e26;
  font-style: italic;
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  gap: 0;
  margin: 1.25rem 0 0;
  border-bottom: 2px solid #d8b98c;
}

.tab-btn {
  padding: 0.5rem 1.4rem;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #88613f;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: transparent;
  cursor: pointer;
  margin-bottom: -2px;
}

.tab-btn:hover { background: #fde0a6; }

.tab-btn.tab-active {
  background: #faf7f2;
  border-color: #d8b98c;
  border-bottom-color: #faf7f2;
  font-weight: bold;
  color: #88613f;
}

/* ── Section bands ── */
.section-band {
  padding: 0.5rem 1rem;
  margin: 1.75rem -1.25rem 1.25rem;
  background: #c1d4d9;
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
}

.band-my {
  font-size: 1.25rem;
  font-weight: 600;
  color: #88613f;
  font-family: Arial, sans-serif;
}

.band-script {
  font-family: 'Dancing Script', cursive;
  font-size: 1.9rem;
  color: #88613f;
  line-height: 1;
}

/* Individual band colors */
.section-band.pause        { background: #c1d4d9; }
.section-band.intent       { background: #c1d4d9; }
.section-band.choices      { background: #c1d4d9; }
.section-band.week-band    { background: #c1d4d9; }
.section-band.notes-band   { background: #dce8eb; }
.section-band.wins-band    { background: #dce8eb; }
.section-band.learnings-band { background: #dce8eb; }
.section-band.patterns-band  { background: #dce8eb; }

/* Section bands inside week layout don't bleed to container edges */
.week-layout .section-band {
  margin-left: 0;
  margin-right: 0;
  margin-top: 1.25rem;
}

/* ── Form fields ── */
.field-group {
  margin-bottom: 1.25rem;
}

.field-group label {
  display: block;
  font-weight: bold;
  color: #88613f;
  margin-bottom: 0.2rem;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
}

.field-group .hint,
.hint {
  display: block;
  font-style: italic;
  color: #8c441b;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
  font-family: Arial, sans-serif;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

textarea, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  border: 1.5px dashed #d8b98c;
  border-radius: 4px;
  background: #fffdf8;
  padding: 0.6rem 0.75rem;
  font-family: Georgia, serif;
  font-size: 0.95rem;
  color: #3a2a1a;
  transition: border-color 0.2s;
  resize: vertical;
}

textarea:focus, input:focus {
  outline: none;
  border-color: #bf6e26;
  background: #fff;
}

textarea.short  { min-height: 2.4em; }
textarea.medium { min-height: 2.4em; }
textarea.tall   { min-height: 130px; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: #88613f;
  color: #fde0a6;
}
.btn-primary:hover { background: #8c441b; }

.btn-secondary {
  background: #c1d4d9;
  color: #bf6e26;
}
.btn-secondary:hover { background: #377989; color: #fff; }

.btn-ghost {
  background: transparent;
  color: #88613f;
  border: 1.5px solid #d8b98c;
}
.btn-ghost:hover { background: #fde0a6; }

.btn-danger {
  background: transparent;
  color: #8c441b;
  border: 1.5px solid #d8b98c;
  font-size: 0.82rem;
  padding: 0.35rem 0.9rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ── Autosave indicator ── */
.save-status {
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  color: #377989;
  font-style: italic;
}
.save-status.error { color: #8c441b; }

/* ── Energy Check link ── */
.energy-check {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.85rem;
  font-family: Arial, sans-serif;
}
.energy-check-link {
  color: #377989;
  text-decoration: underline;
}
.energy-check-link:hover {
  color: #88613f;
}

/* ── Reminder banner ── */
.reminder {
  background: #fde0a6;
  border-left: 4px solid #bf6e26;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}

.reminder-label {
  margin: 0 0 0.2rem;
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
  color: #3a2a1a;
}

.reminder-question {
  margin: 0;
  font-style: italic;
  font-weight: bold;
  font-size: 0.95rem;
  color: #377989;
}

/* ── Auth forms ── */
.auth-card {
  max-width: 420px;
  margin: 3rem auto;
  background: #fff;
  border: 1.5px solid #d8b98c;
  border-radius: 8px;
  padding: 2rem;
}

.auth-card h2 {
  color: #88613f;
  margin-top: 0;
}

.auth-card .field-group { margin-bottom: 1rem; }

.auth-footer {
  margin-top: 1rem;
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  color: #88613f;
}

.auth-footer a { color: #bf6e26; }

/* ── Signup disclosure notice ── */
.disclosure-notice {
  background: #f7efe3;
  border: 1px solid #d8b98c;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.disclosure-heading {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #3a2a1a;
  font-family: Arial, sans-serif;
}
.disclosure-list {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: #3a2a1a;
  font-family: Arial, sans-serif;
  line-height: 1.5;
}
.disclosure-list li {
  margin-bottom: 0.4rem;
}
.disclosure-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-family: Arial, sans-serif;
  color: #3a2a1a;
  cursor: pointer;
}
.disclosure-checkbox input[type="checkbox"] {
  margin-top: 0.15rem;
  accent-color: #377989;
}
.disclosure-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-family: Arial, sans-serif;
  color: #bf6e26;
}

/* ── Terms page ── */
.terms-card {
  max-width: 640px;
}
.terms-body {
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
  color: #3a2a1a;
  line-height: 1.6;
}
.terms-body h3 {
  margin: 1.25rem 0 0.4rem;
  font-size: 1rem;
  color: #3a2a1a;
}
.terms-body p {
  margin: 0 0 0.75rem;
}

/* ── Error / flash messages ── */
.flash {
  padding: 0.65rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}
.flash.error   { background: #fde8e0; color: #8c441b; border-left: 4px solid #8c441b; }
.flash.success { background: #e0f0ee; color: #bf6e26; border-left: 4px solid #377989; }

/* ── Week layout (two-column) ── */
.week-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 0.5rem;
}

.week-col {
  min-width: 0;
}

/* ── Daily planner ── */
.week-planner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.day-row {
  border-bottom: 1px solid #e8ddd0;
  padding-bottom: 0.6rem;
}

.day-header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.day-num {
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: bold;
  color: #fff;
  background: #88613f;
  border-radius: 3px;
  padding: 0.05rem 0.4rem;
  min-width: 1.5rem;
  text-align: center;
}

.day-name {
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #88613f;
}

.day-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.day-input {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border: none;
  border-bottom: 1.5px solid #d8b98c;
  border-radius: 0;
  background: transparent;
  resize: none;
}

.day-input:focus {
  outline: none;
  border-bottom-color: #bf6e26;
  background: #fffdf8;
}

/* ── History list ── */
.practice-list { list-style: none; padding: 0; margin: 0; }

.practice-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid #d8b98c;
  gap: 1rem;
  flex-wrap: wrap;
}

.practice-item:last-child { border-bottom: none; }

.practice-week {
  font-weight: bold;
  color: #88613f;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  min-width: 130px;
}

.practice-preview {
  flex: 1;
  color: #5a4030;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.practice-meta {
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  color: #377989;
}

.badge-draft {
  display: inline-block;
  background: #fde0a6;
  color: #8c441b;
  border: 1px solid #d8b98c;
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-family: Arial, sans-serif;
  margin-left: 0.4rem;
}

.practice-actions { display: flex; gap: 0.5rem; }

/* ── Landing page ── */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero h1 { font-size: 2.8rem; margin-bottom: 0.5rem; }

.hero .tagline {
  color: #bf6e26;
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 2rem;
}

.hero-steps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #88613f;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hero-steps span { color: #d8b98c; }

.hero .cta-group { display: flex; gap: 1rem; justify-content: center; }

/* ── Admin doc cards ── */
.admin-doc-card {
  border: 1.5px solid #d8b98c;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: #fffdf8;
  transition: border-color 0.15s, background 0.15s;
}

.admin-doc-card:hover {
  border-color: #bf6e26;
  background: #fde0a6;
}

.admin-doc-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: #88613f;
}

.admin-doc-card a {
  text-decoration: none;
}

.admin-doc-card a:hover h3 {
  color: #8c441b;
}

.admin-doc-card p {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  color: #5a4030;
}

/* ── Moments tab ── */
.moments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.moment-card {
  border: 1.5px solid #d8b98c;
  border-radius: 8px;
  background: #fffdf8;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.moment-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.moment-title {
  font-family: Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: bold;
  color: #88613f;
}

.moment-subtitle {
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  color: #377989;
  font-weight: 600;
}

.moment-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #5a4030;
  font-style: italic;
  line-height: 1.45;
}

.moment-btn {
  align-self: flex-start;
  margin-top: auto;
}

/* Core flow cards get teal left border */
.moment-see,
.moment-shape,
.moment-shift {
  border-left: 4px solid #377989;
}

/* Rhythm cards get gold left border */
.moment-reset,
.moment-reflection {
  border-left: 4px solid #d9af62;
}

@media (max-width: 620px) {
  .moments-grid { grid-template-columns: 1fr; }
}

/* ── In The Moment tab ── */
.moment-welcome {
  text-align: left;
  margin: 1.5rem 0 1.25rem;
}

.moment-line-a {
  font-family: 'Lato', sans-serif;
  font-size: 10pt;
  font-weight: 400;
  color: #88613f;
  margin: 0 0 0.15rem;
}

.moment-line-b {
  font-family: 'Lato', sans-serif;
  font-size: 12pt;
  font-weight: 700;
  font-style: italic;
  color: #88613f;
  margin: 0 0 0.15rem;
}

.moment-line-c {
  font-family: 'Lato', sans-serif;
  font-size: 10pt;
  font-weight: 400;
  color: #88613f;
  margin: 0;
}

.moment-question {
  text-align: center;
  font-family: 'Lato', sans-serif;
  font-size: 1.1rem;
  color: #377989;
  margin: 1.25rem 0 1rem;
}

.moment-capture-hint {
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  font-weight: normal;
  color: #666;
  margin: 0.5rem 0;
}
.moment-capture-hint em {
  font-weight: normal;
}

/* Two-column layout: buttons left, reveal panel right */
.moment-two-col {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.moment-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 200px;
  flex-shrink: 0;
}

.moment-prompt-btn {
  background: #f5ede3;
  color: #5a4030;
  border: 1.5px solid #d9af62;
  border-radius: 2rem;
  padding: 0.55rem 1.1rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  width: 100%;
}

.moment-prompt-btn:hover,
.moment-prompt-btn:active,
.moment-btn-active {
  background: #bf6e26;
  color: #fff;
  border-color: #bf6e26;
}

/* Reveal panel (right column) */
.moment-reveal-panel {
  flex: 1;
  min-width: 0;
}

.moment-textarea {
  width: 100%;
  border: 1.5px solid #d9af62;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.92rem;
  color: #5a4030;
  background: #faf7f2;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

.moment-textarea:focus {
  outline: none;
  border-color: #bf6e26;
}

/* MIRA chat bubble */
.mira-bubble-link {
  text-decoration: none;
  color: inherit;
  display: block;
  margin-top: 1.5rem;
}

.mira-bubble {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f5ede3;
  border: 1.5px solid #d9af62;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  transition: background 0.15s;
}

.mira-bubble:hover {
  background: #efe4d5;
}

.mira-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.mira-bubble-content {
  flex: 1;
  min-width: 0;
}

.mira-bubble-name {
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #bf6e26;
  margin: 0 0 0.2rem;
}

.mira-bubble-text {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  color: #5a4030;
  margin: 0;
  line-height: 1.4;
}

.moment-tagline {
  text-align: center;
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  color: #88613f;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

/* Mobile: stack columns vertically */
@media (max-width: 620px) {
  .moment-two-col {
    flex-direction: column;
  }
  .moment-buttons-col {
    min-width: unset;
    width: 100%;
  }
}

/* ── My Week tab welcome ── */
.week-welcome {
  text-align: left;
  margin: 1.5rem 0 1.25rem;
}

.week-welcome-a {
  font-family: 'Lato', sans-serif;
  font-size: 12pt;
  font-weight: 700;
  font-style: italic;
  color: #88613f;
  margin: 0 0 0.15rem;
}

.week-welcome-b {
  font-family: 'Lato', sans-serif;
  font-size: 10pt;
  font-weight: 400;
  color: #88613f;
  margin: 0 0 0.15rem;
}

.week-welcome-c {
  font-family: 'Lato', sans-serif;
  font-size: 10pt;
  font-weight: 400;
  color: #88613f;
  margin: 0;
}

p.week-date {
  font-family: 'Lato', sans-serif !important;
  font-size: 10pt !important;
  font-weight: 400;
  color: #377989 !important;
  margin: 0.5rem 0 0;
}

/* ── Look Back welcome header ── */
.lookback-welcome {
  text-align: left;
  margin: 1.5rem 0 1.25rem;
}

.lookback-welcome-a {
  font-size: 2.2rem;
  color: #88613f;
  margin: 0 0 0.25rem;
  line-height: 1.1;
}

.lb-look {
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
}

.lb-back {
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
}

.lookback-welcome-b {
  font-family: 'Lato', sans-serif;
  font-size: 11pt;
  font-weight: 700;
  font-style: italic;
  color: #3d5a60;
  margin: 0;
}

/* ── Footer ── */
footer {
  background: #bf6e26;
  color: #ffffff;
  padding: 1rem;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a { color: #ffffff; }

/* ── Auth hint ── */
.auth-hint {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #5a4030;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

/* ── Summary page ── */
.summary-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1.75rem;
  flex-wrap: wrap;
}

.summary-select {
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #3a2a1a;
  background: #fffdf8;
  border: 1.5px solid #d8b98c;
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.summary-select:focus {
  outline: none;
  border-color: #bf6e26;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Georgia, serif;
}

.sum-th {
  text-align: left;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #88613f;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid #d8b98c;
}

.sum-week {
  vertical-align: top;
  padding: 0.9rem 0.75rem 0.9rem 0;
  border-bottom: 1px solid #e8ddd0;
  min-width: 150px;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  color: #88613f;
  white-space: nowrap;
}

.sum-content {
  vertical-align: top;
  padding: 0.9rem 0.5rem 0.9rem 0.75rem;
  border-bottom: 1px solid #e8ddd0;
  font-size: 0.92rem;
  color: #3a2a1a;
  white-space: pre-wrap;
  line-height: 1.55;
}

.sum-empty {
  color: #b0956e;
  font-style: italic;
  font-size: 0.88rem;
}

/* ── Summary sections ── */
.summary-section-title {
  font-family: Georgia, serif;
  font-size: 1.25rem;
  color: #3a2a1a;
  margin: 0 0 0.25rem;
}

.summary-divider {
  border: none;
  border-top: 2px solid #bf6e26;
  margin: 2rem 0;
}

.signals-section {
  margin-bottom: 1rem;
}

.sig-prompt {
  vertical-align: top;
  padding: 0.9rem 0.75rem 0.9rem 0;
  border-bottom: 1px solid #e8ddd0;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  color: #88613f;
  min-width: 90px;
  max-width: 130px;
  line-height: 1.35;
}

.sig-count {
  vertical-align: top;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid #e8ddd0;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  color: #3a2a1a;
  text-align: center;
  min-width: 60px;
}

.sig-notes-cell {
  vertical-align: top;
  padding: 0.9rem 0.5rem 0.9rem 0.75rem;
  border-bottom: 1px solid #e8ddd0;
  font-size: 0.92rem;
  color: #3a2a1a;
  line-height: 1.55;
}

.signal-notes {
  list-style: disc;
  padding-left: 1.2rem;
  margin: 0;
}

.signal-notes li {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  color: #3a2a1a;
  line-height: 1.5;
  margin-bottom: 0.2rem;
}

.weeks-section {
  margin-top: 1rem;
}

/* ── Moment save button ── */
.moment-save-btn {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ── Chat ── */
.chat-model-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chat-messages {
  border: 1.5px solid #d8b98c;
  border-radius: 6px;
  background: #fffdf8;
  min-height: 400px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-bubble {
  max-width: 80%;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-bubble.user {
  align-self: flex-end;
  background: #bf6e26;
  color: #c1d4d9;
  border-bottom-right-radius: 2px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: #e0f0ee;
  color: #3a2a1a;
  border-bottom-left-radius: 2px;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chat-input-row input[type="text"] {
  flex: 1;
  border-style: solid;
}

.chat-input-row .btn { flex-shrink: 0; }

/* ── Chat layout with sidebar ── */
.chat-layout {
  display: flex;
  gap: 0.75rem;
  min-height: 500px;
}

.chat-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #f5ede3;
  border: 1.5px solid #d8b98c;
  border-radius: 6px;
  padding: 0.75rem;
  overflow-y: auto;
  max-height: 70vh;
}

.chat-main {
  flex: 1;
  min-width: 0;
}

.chat-new-btn {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  background: #88613f;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
}
.chat-new-btn:hover { background: #a0764e; }

.chat-session-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-session-item {
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  color: #3a2a1a;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.chat-session-item:hover { background: #ebe0d2; }
.chat-session-item.active {
  background: #d8b98c;
  font-weight: bold;
}

.session-title {
  cursor: text;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-delete-btn {
  background: none;
  border: none;
  color: #b08968;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
  opacity: 0.5;
}
.session-delete-btn:hover { color: #c0392b; opacity: 1; }
.chat-session-item:hover .session-delete-btn { opacity: 1; }

.session-rename-input {
  width: 100%;
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  font-family: Arial, sans-serif;
  border: 1px solid #d8b98c;
  border-radius: 3px;
  background: #fff;
}

.sidebar-toggle {
  display: none;
  background: #88613f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

/* ── Bottom tab bar (hidden on desktop) ── */
.bottom-nav {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 620px) {
  .field-row { grid-template-columns: 1fr; }
  .week-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .section-band { margin-left: -1.25rem; margin-right: -1.25rem; }
  .week-layout .section-band { margin-left: 0; margin-right: 0; }
  .chat-bubble { max-width: 90%; }

  /* Hide top nav links — replaced by bottom bar */
  nav .nav-links { display: none; }

  /* Push page content above the bar; env() handles iPhone home indicator */
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

  /* Bottom tab bar */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #bf6e26;
    border-top: 1.5px solid #a35d20;
    z-index: 1000;
    align-items: stretch;
  }

  .bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    gap: 3px;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-tab svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-tab:active,
  .bottom-tab.bottom-tab-active {
    color: #fde0a6;
  }

  /* Chat sidebar: collapsible on mobile */
  .sidebar-toggle { display: block; }
  .chat-layout { flex-direction: column; }
  .chat-sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 999;
    border-radius: 0;
    border: none;
    border-right: 1.5px solid #d8b98c;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    max-height: 100vh;
  }
  .chat-sidebar.open { display: block; }
}

/* ── Moment signal snippet (inline feedback after save) ── */
.moment-signal-snippet {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  color: #88613f;
  background: #fdf5e6;
  border-left: 3px solid #d9af62;
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
  border-radius: 0 4px 4px 0;
}

/* ── Account Deletion Confirmation Pages ──────────────────────────── */
.confirm-page { max-width: 420px; margin: 0 auto; padding: 3rem 2rem 6rem; font-family: 'Lato', sans-serif; }
.confirm-back { display: inline-block; color: #a08060; font-size: 0.8rem; text-decoration: none; margin-bottom: 1.5rem; }
.confirm-back:hover { color: #bf6e26; }
.confirm-title { font-size: 1.1rem; font-weight: 600; color: #3a2a1a; margin-bottom: 0.5rem; }
.confirm-subtitle { font-size: 0.8rem; color: #88613f; margin-bottom: 1.5rem; line-height: 1.5; }

.confirm-warning-box {
    background: rgba(192, 57, 43, 0.06);
    border: 1px solid rgba(192, 57, 43, 0.2);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.78rem;
    color: #8b3a2a;
    line-height: 1.5;
}

.confirm-data-summary {
    background: #fff;
    border: 1px solid #e0d4c4;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.78rem;
    color: #3a2a1a;
}
.confirm-data-summary dt { font-weight: 600; display: inline; }
.confirm-data-summary dd { display: inline; margin-left: 0.3rem; color: #88613f; }
.confirm-data-summary .data-row { margin-bottom: 0.4rem; }

.confirm-step {
    background: #fff;
    border: 1px solid #e0d4c4;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: opacity 0.3s, border-color 0.3s;
}
.confirm-step.locked { opacity: 0.5; pointer-events: none; }
.confirm-step.active { border-color: #d9af62; }
.confirm-step-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #88613f;
    margin-bottom: 0.6rem;
}

.confirm-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: #3a2a1a;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    cursor: pointer;
}
.confirm-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #c0392b;
    flex-shrink: 0;
}

.confirm-input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid #e0d4c4;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    background: #fff;
    margin-top: 0.4rem;
}
.confirm-input:focus { outline: none; border-color: #c0392b; }
.confirm-input-hint { font-size: 0.7rem; color: #a08060; margin-top: 0.3rem; }

.confirm-reason-select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid #e0d4c4;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    background: #fff;
    color: #3a2a1a;
    appearance: auto;
}

.confirm-btn-danger {
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #c0392b;
    color: #fff;
    margin-top: 1rem;
    transition: background 0.2s, opacity 0.2s;
}
.confirm-btn-danger:hover:not(:disabled) { background: #a93226; }
.confirm-btn-danger:disabled { background: #ccc; color: #888; cursor: not-allowed; opacity: 0.7; }

.confirm-btn-secondary {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #e0d4c4;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    background: #fff;
    color: #88613f;
    cursor: pointer;
    margin-top: 0.5rem;
    text-align: center;
    text-decoration: none;
    display: block;
}
.confirm-btn-secondary:hover { border-color: #d9af62; color: #bf6e26; }

.goodbye-page {
    max-width: 420px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
    font-family: 'Lato', sans-serif;
}
.goodbye-page h1 { font-size: 1.2rem; color: #3a2a1a; margin-bottom: 1rem; }
.goodbye-page p { font-size: 0.85rem; color: #88613f; line-height: 1.6; margin-bottom: 1rem; }
