/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg:            #F8F4EF;
  --surface:       #FFFFFF;
  --sage:          #6B8E6B;
  --sage-dk:       #4A6A4A;
  --sage-lt:       #C5DCC5;
  --sage-pale:     #EBF3EB;
  --warm:          #C4956A;
  --warm-lt:       #F2E3D3;
  --warm-pale:     #FBF3EB;
  --rose:          #C49090;
  --purple-pale:   #F3ECF8;
  --text:          #3D3227;
  --text-muted:    #7A6E65;
  --text-light:    #A89E96;
  --border:        #E0D8D0;
  --border-lt:     #EDE8E3;
  --radius:        14px;
  --radius-sm:     8px;
  --radius-lg:     22px;
  --shadow-sm:     0 2px 8px rgba(61,50,39,.07);
  --shadow-md:     0 4px 18px rgba(61,50,39,.11);
  --shadow-lg:     0 8px 32px rgba(61,50,39,.14);
  --t:             .22s ease;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans TC', 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; }
a { color: var(--sage-dk); text-decoration: none; }
a:hover { color: var(--sage); }

h1,h2,h3,h4,h5 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, var(--sage-dk) 0%, var(--sage) 100%);
  padding: 0 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 200;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 1rem;
}
.navbar-brand {
  font-family: 'Lora', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
}
.navbar-nav {
  display: flex;
  list-style: none;
  gap: .25rem;
  align-items: center;
  flex-wrap: wrap;
}
.navbar-nav a {
  color: rgba(255,255,255,.85);
  padding: .38rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: var(--t);
}
.navbar-nav a:hover { color: #fff; background: rgba(255,255,255,.15); }
.nav-divider { width: 1px; height: 24px; background: rgba(255,255,255,.25); margin: 0 .25rem; }
.nav-user { display: flex; align-items: center; gap: .45rem; }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  color: #fff; font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.btn-outline-nav {
  border: 1.5px solid rgba(255,255,255,.5) !important;
  color: rgba(255,255,255,.9) !important;
  background: transparent !important;
  padding: .3rem .85rem !important;
}
.btn-outline-nav:hover { background: rgba(255,255,255,.15) !important; color: #fff !important; }
.btn-nav {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  border: 1.5px solid rgba(255,255,255,.4) !important;
  padding: .3rem .85rem !important;
}
.btn-nav:hover { background: rgba(255,255,255,.3) !important; }

/* ─── Main + Footer ──────────────────────────────────────────── */
.main-content { flex: 1; }
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
.footer-brand strong { font-family: 'Lora', serif; font-size: 1.1rem; color: var(--sage-dk); }
.footer-brand span { color: var(--text-muted); font-size: .85rem; }
.footer-note { color: var(--text-muted); font-size: .825rem; max-width: 480px; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.messages-container { max-width: 900px; margin: 1rem auto 0; padding: 0 1.5rem; }
.alert {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: .6rem;
  animation: fadeIn .3s ease;
}
.alert-success, .alert-successmessage { background: var(--sage-pale); color: var(--sage-dk); border: 1px solid var(--sage-lt); }
.alert-error, .alert-warning { background: #FBE9E9; color: #7A3535; border: 1px solid #F0C0C0; }
.alert-info { background: var(--warm-pale); color: #7A5A3A; border: 1px solid var(--warm-lt); }
.alert-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: .6; padding: 0 .2rem; }
.alert-close:hover { opacity: 1; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ─── Container / Layout ─────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.page-container { padding-top: 2.5rem; padding-bottom: 3rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.9rem; margin-bottom: .3rem; }
.page-header p { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-lt);
  overflow: hidden;
}
.card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-lt);
  background: var(--bg);
}
.card-header h3 { font-size: 1rem; margin: 0; }
.card-body { padding: 1.5rem; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.3rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: var(--t);
  border: 2px solid transparent;
  font-family: inherit; text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--sage); color: #fff; border-color: var(--sage); }
.btn-primary:hover { background: var(--sage-dk); border-color: var(--sage-dk); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-warm { background: var(--warm); color: #fff; border-color: var(--warm); }
.btn-warm:hover { background: #b8845a; color: #fff; }
.btn-outline { background: transparent; color: var(--sage-dk); border-color: var(--sage); }
.btn-outline:hover { background: var(--sage); color: #fff; }
.btn-danger { background: #C4696A; color: #fff; border-color: #C4696A; }
.btn-danger:hover { background: #A85555; color: #fff; }
.btn-danger-outline { color: #C4696A !important; border-color: #C4696A !important; }
.btn-danger-outline:hover { background: #C4696A !important; color: #fff !important; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
.form-hint { font-weight: 400; color: var(--text-muted); font-size: .8rem; }
.form-control {
  width: 100%; padding: .65rem 1rem;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9rem; font-family: inherit; color: var(--text);
  background: #fff; transition: var(--t);
}
.form-control:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-pale); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A6E65' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.form-error { color: #B85555; font-size: .8rem; margin-top: .3rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

/* ─── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 62px - 120px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 2.5rem;
  width: 100%; max-width: 420px;
  border: 1px solid var(--border-lt);
}
.auth-card-wide { max-width: 600px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.7rem; margin-bottom: .4rem; }
.auth-header p { color: var(--text-muted); }
.auth-form .btn-block { margin-top: .5rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text-muted); }
.auth-footer a { color: var(--sage-dk); font-weight: 600; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--sage-dk) 0%, var(--sage) 60%, #8BAC8B 100%);
  color: #fff;
  padding: 5rem 2rem;
  display: flex; align-items: center; justify-content: center;
  gap: 4rem; flex-wrap: wrap; position: relative; overflow: hidden;
}
.hero-content { max-width: 520px; }
.hero-title { font-size: 3rem; font-weight: 600; color: #fff; margin-bottom: 1rem; line-height: 1.15; }
.hero-title em { color: rgba(255,255,255,.8); font-style: italic; }
.hero-subtitle { font-size: 1.1rem; color: rgba(255,255,255,.85); margin-bottom: 2rem; line-height: 1.7; max-width: 440px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-actions .btn-primary { background: #fff; color: var(--sage-dk); border-color: #fff; }
.hero-actions .btn-primary:hover { background: var(--warm-pale); border-color: var(--warm-pale); }
.hero-actions .btn-warm { background: var(--warm); border-color: var(--warm); color: #fff; }
.hero-actions .btn-outline { border-color: rgba(255,255,255,.7); color: #fff; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.15); color: #fff; }
.hero-illustration { position: relative; width: 180px; height: 180px; }
.hero-circle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero-circle-1 { width: 180px; height: 180px; top: 0; left: 0; }
.hero-circle-2 { width: 130px; height: 130px; top: 25px; left: 25px; background: rgba(255,255,255,.1); }
.hero-circle-3 { width: 80px; height: 80px; top: 50px; left: 50px; background: rgba(255,255,255,.12); }
.hero-icon-wrap { position: absolute; top: 50px; left: 50px; }

/* ─── Features ───────────────────────────────────────────────── */
.features { padding: 5rem 1.5rem; }
.section-title { text-align: center; font-size: 1.8rem; margin-bottom: .5rem; }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 3rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.feature-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-lt);
  transition: var(--t);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-icon {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.feature-card p { color: var(--text-muted); font-size: .9rem; }

/* ─── Values ─────────────────────────────────────────────────── */
.values { background: var(--surface); padding: 4rem 1.5rem; border-top: 1px solid var(--border-lt); border-bottom: 1px solid var(--border-lt); }
.values-grid { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.value-item { display: flex; gap: 1rem; align-items: flex-start; }
.value-icon { font-size: 1.6rem; flex-shrink: 0; margin-top: .1rem; }
.value-item h4 { font-size: .95rem; margin-bottom: .25rem; }
.value-item p { color: var(--text-muted); font-size: .85rem; }

/* ─── CTA ────────────────────────────────────────────────────── */
.cta-section { padding: 4rem 1.5rem; }
.cta-card {
  max-width: 680px; margin: 0 auto;
  background: linear-gradient(135deg, var(--sage-pale), var(--warm-pale));
  border-radius: var(--radius-lg); padding: 3rem 2rem;
  text-align: center; border: 1px solid var(--border-lt);
}
.cta-card h2 { font-size: 1.7rem; margin-bottom: .75rem; }
.cta-card p { color: var(--text-muted); margin-bottom: 1.75rem; }

/* ─── Consultants grid ───────────────────────────────────────── */
.consultants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.consultant-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-lt);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem;
  transition: var(--t);
}
.consultant-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.consultant-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sage-lt), var(--sage));
  color: #fff; font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif;
}
.consultant-info h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.consultant-bio { color: var(--text-muted); font-size: .875rem; }
.consultant-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

/* ─── Profile ────────────────────────────────────────────────── */
.profile-card {}
.profile-banner {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(135deg, var(--sage-pale), var(--warm-pale));
  border-bottom: 1px solid var(--border-lt);
  flex-wrap: wrap;
}
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--sage-lt), var(--sage));
  color: #fff; font-size: 1.9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif;
}
.profile-banner h2 { font-size: 1.4rem; margin-bottom: .3rem; }

/* ─── Role badges ────────────────────────────────────────────── */
.role-badge {
  display: inline-block; padding: .2rem .7rem;
  border-radius: 999px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.role-badge-user { background: var(--warm-lt); color: #8B6040; }
.role-badge-consultant { background: var(--sage-pale); color: var(--sage-dk); }
.role-badge-admin { background: var(--purple-pale); color: #6B4A9B; }

/* ─── Status badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-block; padding: .2rem .7rem;
  border-radius: 999px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.status-badge-pending  { background: #FFF4E0; color: #8B6A20; }
.status-badge-confirmed { background: var(--sage-pale); color: var(--sage-dk); }
.status-badge-cancelled { background: #FBE9E9; color: #8B3535; }
.status-badge-completed { background: var(--border-lt); color: var(--text-muted); }

/* ─── Appointments list ──────────────────────────────────────── */
.appointments-list { display: flex; flex-direction: column; gap: 1rem; }
.appointment-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border-lt); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.appointment-card.status-cancelled { opacity: .75; }
.appt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-lt);
  background: var(--bg); flex-wrap: wrap; gap: .5rem;
}
.appt-consultant { display: flex; align-items: center; gap: .75rem; }
.consultant-avatar-sm {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--sage-lt), var(--sage));
  color: #fff; font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.consultant-mini { display: flex; align-items: center; gap: .75rem; }
.appt-body { padding: 1rem 1.5rem; }
.appt-datetime { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .5rem; }
.appt-date { font-weight: 600; font-size: .95rem; }
.appt-time { color: var(--text-muted); font-size: .875rem; }
.appt-notes { color: var(--text-muted); font-size: .875rem; font-style: italic; }
.appt-actions { padding: .75rem 1.5rem; border-top: 1px solid var(--border-lt); background: var(--bg); display: flex; gap: .6rem; flex-wrap: wrap; }

/* ─── Booking summary ────────────────────────────────────────── */
.booking-summary {
  background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border); padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.summary-row { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px solid var(--border-lt); }
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-muted); font-size: .875rem; }
.summary-value { font-weight: 600; font-size: .9rem; text-align: right; }

/* ─── Calendar ───────────────────────────────────────────────── */
.calendar-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .calendar-layout { grid-template-columns: 1fr; } }

.calendar-main { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-lt); box-shadow: var(--shadow-sm); overflow: hidden; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; background: var(--bg); border-bottom: 1px solid var(--border-lt); }
.calendar-month { font-size: 1.15rem; margin: 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding: .5rem .25rem; border-bottom: 1px solid var(--border-lt); background: var(--bg); }
.cal-day {
  min-height: 90px; padding: .5rem;
  border-right: 1px solid var(--border-lt);
  border-bottom: 1px solid var(--border-lt);
  vertical-align: top; cursor: default;
  transition: background var(--t);
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day.empty { background: var(--bg); cursor: default; }
.cal-day.past { background: var(--bg); opacity: .7; }
.cal-day.today { background: var(--sage-pale); }
.cal-day:not(.past):not(.empty):hover { background: var(--warm-pale); cursor: pointer; }
.cal-day-num { font-size: .8rem; font-weight: 700; color: var(--text-muted); margin-bottom: .3rem; }
.cal-day.today .cal-day-num { color: var(--sage-dk); background: var(--sage); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; }
.slot-container { display: flex; flex-direction: column; gap: .2rem; }
.slot-pill {
  display: block; padding: .15rem .4rem; border-radius: 999px;
  font-size: .7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: var(--t);
}
.slot-available { background: var(--sage); color: #fff; cursor: pointer; }
.slot-available:hover { background: var(--sage-dk); transform: scale(1.02); }
.slot-booked { background: var(--border); color: var(--text-muted); cursor: default; }
.del-btn { margin-left: .2rem; font-size: .8rem; opacity: .7; cursor: pointer; }
.del-btn:hover { opacity: 1; }

.legend-list { display: flex; flex-direction: column; gap: .75rem; }
.legend-item { display: flex; align-items: center; gap: .65rem; font-size: .825rem; color: var(--text-muted); }

/* ─── Back link ──────────────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--sage-dk); font-size: .875rem; font-weight: 600;
  margin-bottom: 1rem; transition: var(--t);
}
.back-link:hover { color: var(--sage); }

/* ─── Detail CTA ─────────────────────────────────────────────── */
.detail-cta { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.bio-text { color: var(--text-muted); line-height: 1.75; }
.section-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .75rem; margin-top: 1.5rem; }
.section-label:first-child { margin-top: 0; }

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
  overflow: hidden; animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem; background: var(--bg);
  border-bottom: 1px solid var(--border-lt);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 1.5rem; }
.modal-date-display { font-weight: 600; color: var(--sage-dk); margin-bottom: 1.2rem; font-family: 'Lora', serif; }
.modal-footer { display: flex; gap: .75rem; justify-content: flex-end; padding: 1rem 1.5rem; border-top: 1px solid var(--border-lt); background: var(--bg); }

/* ─── Chat ───────────────────────────────────────────────────── */
.chat-page {
  display: flex; height: calc(100vh - 62px);
  max-height: calc(100vh - 62px);
}
.chat-sidebar {
  width: 280px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border-lt);
  overflow-y: auto; display: flex; flex-direction: column;
}
@media (max-width: 700px) { .chat-sidebar { display: none; } }
.chat-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-lt); }
.chat-peer {
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center; border-bottom: 1px solid var(--border-lt);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.chat-peer h3 { font-size: 1rem; }
.chat-peer .profile-avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.session-info { padding: 1rem 1.25rem; font-size: .85rem; display: flex; flex-direction: column; gap: .5rem; }
.session-row { display: flex; justify-content: space-between; }
.session-label { color: var(--text-muted); }

.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-topbar {
  padding: 1rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--border-lt);
  display: flex; align-items: center; gap: .75rem;
  font-weight: 600; box-shadow: var(--shadow-sm); z-index: 10;
}
.chat-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: var(--t);
}
.chat-status-dot.connected { background: #6EBF6E; box-shadow: 0 0 0 3px rgba(110,191,110,.25); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  background: var(--bg);
}
.msg-row { display: flex; }
.msg-mine { justify-content: flex-end; }
.msg-theirs { justify-content: flex-start; }
.msg-bubble {
  max-width: 70%; padding: .7rem 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.msg-mine .msg-bubble { background: var(--sage); color: #fff; border-bottom-right-radius: 4px; }
.msg-theirs .msg-bubble { background: var(--surface); border: 1px solid var(--border-lt); border-bottom-left-radius: 4px; }
.msg-text { font-size: .9rem; line-height: 1.5; word-break: break-word; }
.msg-meta { display: block; font-size: .7rem; margin-top: .35rem; opacity: .7; }
.msg-mine .msg-meta { text-align: right; }

.chat-empty { margin: auto; text-align: center; color: var(--text-muted); font-size: .9rem; }
.chat-empty p { line-height: 1.8; }

.chat-input-area {
  padding: 1rem 1.5rem; background: var(--surface);
  border-top: 1px solid var(--border-lt);
}
.chat-form { display: flex; gap: .75rem; }
.chat-input {
  flex: 1; padding: .65rem 1rem;
  border: 2px solid var(--border); border-radius: 999px;
  font-size: .9rem; font-family: inherit; background: var(--bg);
  transition: var(--t);
}
.chat-input:focus { outline: none; border-color: var(--sage); background: #fff; box-shadow: 0 0 0 3px var(--sage-pale); }
.chat-send { border-radius: 999px; }

/* ─── Misc helpers ───────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.small { font-size: .8rem; }
