@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:          #060c05;
  --bg-2:        #0a1208;
  --surface:     #0e160a;
  --card:        #13190e;
  --card-hover:  #182012;
  --card-alt:    #0e160a;
  --border:      #1f2d17;
  --border-2:    #2c3e22;
  --gold:        #D4AF37;
  --gold-light:  #E8CC6A;
  --gold-bright: #F5E09A;
  --gold-dim:    rgba(212,175,55,0.10);
  --gold-border: rgba(212,175,55,0.25);
  --green:       #043717;
  --green-mid:   #065c27;
  --green-light: #2ecc71;
  --green-dim:   rgba(4,55,23,0.30);
  --green-border:rgba(46,204,113,0.25);
  --accent:      #D4AF37;
  --text:        #FFFFFF;
  --text-soft:   rgba(255,255,255,0.85);
  --text-dim:    rgba(255,255,255,0.38);
  --text-muted:  rgba(255,255,255,0.12);
  --success:     #2ecc71;
  --danger:      #C0392B;
  --danger-dim:  rgba(192,57,43,0.12);
  --info:        #D4AF37;
  --radius:      14px;
  --radius-sm:   9px;
  --radius-xs:   6px;
  --shadow:      0 2px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.75);
  --shadow-gold: 0 0 24px rgba(212,175,55,0.18);
}

[data-theme="light"] {
  --bg:          #FFFFFF;
  --bg-2:        #F5F2EA;
  --surface:     #FAFAF7;
  --card:        #FFFFFF;
  --card-hover:  #F8F5ED;
  --card-alt:    #F5F2EA;
  --border:      #E5DFC8;
  --border-2:    #CEC6AC;
  --gold:        #B8960C;
  --gold-light:  #9A7D00;
  --gold-bright: #7D6400;
  --gold-dim:    rgba(212,175,55,0.12);
  --gold-border: rgba(184,150,12,0.35);
  --green:       #043717;
  --green-mid:   #065c27;
  --green-light: #043717;
  --green-dim:   rgba(4,55,23,0.08);
  --green-border:rgba(4,55,23,0.22);
  --accent:      #B8960C;
  --text:        #1A1A14;
  --text-soft:   #333328;
  --text-dim:    #787060;
  --text-muted:  #B8B0A0;
  --success:     #065c27;
  --danger:      #C0392B;
  --danger-dim:  rgba(192,57,43,0.08);
  --info:        #B8960C;
  --shadow:      0 2px 16px rgba(0,0,0,0.06);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.12);
  --shadow-gold: 0 0 24px rgba(184,150,12,0.15);
}

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

body {
  font-family:'Inter',-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
  display:flex;
  height:100vh;
  overflow:hidden;
  font-size:14px;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

h1,h2,h3,.font-display {
  font-family:'Playfair Display','Georgia',serif;
  letter-spacing:-0.02em;
}

::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border-2); border-radius:3px; }

.hidden { display:none !important; }

/* ─── SIDEBAR ───────────────────────────────────────── */
#sidebar {
  width:268px;
  min-width:268px;
  background:var(--surface);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  height:100vh;
}

.sidebar-header {
  padding:22px 18px 14px;
  border-bottom:1px solid var(--border);
}

.logo {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:16px;
}

.logo-gem {
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  filter:drop-shadow(0 0 8px rgba(212,175,55,0.45));
}

.logo-text {
  font-family:'Playfair Display',serif;
  font-size:17px;
  font-weight:700;
  letter-spacing:-0.01em;
  line-height:1;
}
.logo-text span { color:var(--gold); }
.logo-sub {
  font-family:'Inter',sans-serif;
  font-size:9px;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:2px;
  color:var(--text-dim);
  margin-top:3px;
}

.btn-new-patient {
  width:100%;
  background:linear-gradient(135deg,var(--green),var(--green-mid));
  color:#fff;
  border:none;
  border-radius:var(--radius-sm);
  padding:10px 14px;
  font-size:12.5px;
  font-weight:600;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:7px;
  transition:opacity 0.15s;
}
.btn-new-patient:hover { opacity:0.85; }

/* Sidebar nav */
.sidebar-nav {
  display:flex;
  gap:4px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}
.nav-btn {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  padding:8px 4px;
  border:1px solid transparent;
  border-radius:var(--radius-sm);
  background:transparent;
  color:var(--text-dim);
  font-size:9.5px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.7px;
  cursor:pointer;
}
.nav-btn:hover { background:var(--green-dim); color:var(--text-soft); border-color:var(--green-border); }
.nav-btn.active { background:var(--green-dim); border-color:var(--green-border); color:var(--green-light); }
.nav-btn-icon { font-size:15px; }

.sidebar-search { padding:10px 16px; border-bottom:1px solid var(--border); }

.search-input {
  width:100%;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  padding:8px 12px;
  font-size:12.5px;
  outline:none;
  transition:border-color 0.15s;
}
.search-input:focus { border-color:var(--green-mid); }
.search-input::placeholder { color:var(--text-dim); }

.sidebar-list { flex:1; overflow-y:auto; padding:6px 10px; }

.sidebar-section-label {
  font-size:9.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1.2px;
  color:var(--text-dim);
  padding:8px 8px 4px;
}

.patient-item {
  padding:9px 10px;
  border-radius:var(--radius-sm);
  cursor:pointer;
  margin-bottom:3px;
  border:1px solid transparent;
  display:flex;
  align-items:center;
  gap:9px;
}
.patient-item-avatar {
  width:32px; height:32px;
  border-radius:50%;
  background:var(--green-dim);
  border:1px solid var(--green-border);
  display:flex; align-items:center; justify-content:center;
  font-size:15px; flex-shrink:0;
  font-weight:700;
}
.patient-item:hover { background:var(--card); border-color:var(--border); }
.patient-item.active {
  background:var(--green-dim);
  border-color:var(--green-border);
}

.patient-item-name {
  font-size:13px;
  font-weight:600;
  color:var(--text-soft);
  margin-bottom:2px;
}
.patient-item.active .patient-item-name { color:var(--green-light); }
.patient-item-meta { font-size:11px; color:var(--text-dim); }

/* Avatar picker */
.avatar-opt {
  width:36px; height:36px; border-radius:50%;
  border:2px solid var(--border);
  background:var(--card-alt);
  cursor:pointer; font-size:18px;
  display:flex; align-items:center; justify-content:center;
  transition:all 0.15s; flex-shrink:0;
}
.avatar-opt-letter { font-size:11px; color:var(--text-dim); font-weight:700; }
.avatar-opt:hover { border-color:var(--green-border); background:var(--green-dim); }
.avatar-opt.active { border-color:var(--accent); box-shadow:0 0 0 2px rgba(212,175,55,0.3); }

.sidebar-empty {
  text-align:center;
  color:var(--text-dim);
  font-size:12px;
  padding:32px 16px;
  line-height:1.6;
}

/* Upcoming sessions in sidebar */
.sidebar-upcoming {
  padding:8px 12px;
  border-top:1px solid var(--border);
}
.sidebar-upcoming-title {
  font-size:9.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1.2px;
  color:var(--text-dim);
  padding:6px 4px 8px;
}
.upcoming-item {
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 8px;
  border-radius:var(--radius-xs);
  cursor:pointer;
  transition:background 0.15s;
  margin-bottom:2px;
}
.upcoming-item:hover { background:var(--card); }
.upcoming-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--gold);
  flex-shrink:0;
}
.upcoming-dot.today { background:var(--green-light); box-shadow:0 0 6px var(--green-light); }
.upcoming-info { flex:1; min-width:0; }
.upcoming-patient { font-size:12px; font-weight:600; color:var(--text-soft); truncate:ellipsis; white-space:nowrap; overflow:hidden; }
.upcoming-date { font-size:10px; color:var(--text-dim); margin-top:1px; }

/* Sidebar footer */
.sidebar-footer {
  padding:10px 14px;
  border-top:1px solid var(--border);
  display:flex;
  gap:6px;
}
.btn-sidebar-action {
  flex:1;
  background:transparent;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text-dim);
  padding:7px 10px;
  font-size:11px;
  cursor:pointer;
  text-align:center;
  transition:all 0.15s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
}
.btn-sidebar-action:hover { background:var(--card); color:var(--text-soft); border-color:var(--border-2); }

/* ─── MAIN ──────────────────────────────────────────── */
#main { flex:1; overflow-y:auto; display:flex; flex-direction:column; position:relative; }

/* ─── DASHBOARD ─────────────────────────────────────── */
.dashboard {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:48px 32px;
  text-align:center;
  min-height:100%;
}

.dashboard-gem {
  width:90px;
  height:90px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 28px;
  animation:gem-breathe 4s ease-in-out infinite;
}

@keyframes gem-breathe {
  0%,100% { filter:drop-shadow(0 0 16px rgba(212,175,55,0.35)) drop-shadow(0 0 40px rgba(212,175,55,0.1)); }
  50%      { filter:drop-shadow(0 0 32px rgba(212,175,55,0.65)) drop-shadow(0 0 60px rgba(212,175,55,0.2)); }
}

.dashboard h1 {
  font-family:'Playfair Display',serif;
  font-size:36px;
  font-weight:600;
  margin-bottom:10px;
  letter-spacing:-0.03em;
  line-height:1.1;
}
.dashboard h1 span { color:var(--gold); }
.dashboard > p { color:var(--text-dim); font-size:14px; max-width:400px; margin:0 auto; line-height:1.75; }

.stats-row {
  display:flex;
  gap:14px;
  margin-top:40px;
  flex-wrap:wrap;
  justify-content:center;
}

.stat-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px 28px;
  text-align:center;
  min-width:120px;
  box-shadow:var(--shadow);
}
.stat-card:hover { border-color:var(--gold-border); box-shadow:var(--shadow-gold); }

.stat-number {
  font-family:'Playfair Display',serif;
  font-size:42px;
  font-weight:700;
  color:var(--gold);
  line-height:1;
  position:relative;
}
.stat-label { font-size:10.5px; color:var(--text-dim); margin-top:6px; text-transform:uppercase; letter-spacing:1px; }

/* Upcoming sessions on dashboard */
.dashboard-upcoming {
  margin-top:32px;
  width:100%;
  max-width:600px;
}
.dashboard-upcoming-title {
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1px;
  color:var(--text-dim);
  text-align:left;
  margin-bottom:10px;
}
.dashboard-upcoming-list { display:flex; flex-direction:column; gap:8px; }
.dashboard-upcoming-item {
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:var(--card);
  border:1px solid var(--border);
  border-left:3px solid var(--gold);
  border-radius:var(--radius-sm);
  padding:10px 16px;
  cursor:pointer;
  transition:all 0.15s;
  text-align:left;
}
.dashboard-upcoming-item:hover { border-color:var(--gold-border); background:var(--card-hover); }
.dashboard-upcoming-item.today { border-left-color:var(--green-light); }
.dui-patient { font-size:13px; font-weight:600; color:var(--text); }
.dui-meta { font-size:11px; color:var(--text-dim); margin-top:2px; }
.dui-date { font-size:11px; color:var(--gold); font-weight:600; }

.api-warning {
  margin-top:24px;
  background:var(--gold-dim);
  border:1px solid var(--gold-border);
  border-radius:var(--radius-sm);
  padding:12px 16px;
  font-size:12.5px;
  color:var(--gold-light);
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  max-width:560px;
}

/* ─── PAGE HEADER ────────────────────────────────────── */
.page-header {
  padding:22px 30px 14px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  background:var(--surface);
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.page-header-left { flex:1; }

.breadcrumb {
  font-size:11px;
  color:var(--text-dim);
  margin-bottom:5px;
  display:flex;
  align-items:center;
  gap:6px;
}
.breadcrumb a { color:var(--gold); cursor:pointer; text-decoration:none; transition:color 0.15s; }
.breadcrumb a:hover { color:var(--gold-light); }

.page-title {
  font-family:'Playfair Display',serif;
  font-size:26px;
  font-weight:600;
  letter-spacing:-0.025em;
  line-height:1.1;
}
.page-subtitle { font-size:12.5px; color:var(--text-dim); margin-top:4px; }
.page-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; flex-wrap:wrap; }

/* ─── BUTTONS ────────────────────────────────────────── */
.btn {
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:8px 16px;
  border-radius:var(--radius-sm);
  font-size:12.5px;
  font-weight:600;
  border:1px solid transparent;
  cursor:pointer;
  white-space:nowrap;
  font-family:'Inter',sans-serif;
  transition:all 0.15s;
}
.btn:disabled { opacity:0.38; cursor:not-allowed; }

.btn-primary {
  background:linear-gradient(135deg,var(--green),var(--green-mid));
  color:#fff;
  border-color:rgba(46,204,113,0.2);
}
.btn-primary:hover:not(:disabled) {
  opacity:0.88;
}

.btn-gold {
  background:linear-gradient(135deg,#8B6914,var(--gold));
  color:#fff;
  border-color:rgba(212,175,55,0.3);
}
.btn-gold:hover:not(:disabled) {
  opacity:0.9;
}

.btn-ghost {
  background:transparent;
  color:var(--text-dim);
  border-color:var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background:var(--card);
  color:var(--text-soft);
  border-color:var(--border-2);
}

.btn-danger {
  background:transparent;
  color:var(--danger);
  border:1px solid rgba(181,52,30,0.25);
}
.btn-danger:hover:not(:disabled) { background:var(--danger-dim); }

.btn-sm { padding:6px 12px; font-size:11.5px; }
.btn-xs { padding:4px 9px; font-size:11px; }

/* ─── CONTENT ────────────────────────────────────────── */
.content { padding:22px 30px; flex:1; }

/* ─── CARD ───────────────────────────────────────────── */
.card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  margin-bottom:16px;
  transition:border-color 0.2s;
}
.card:hover { border-color:var(--border-2); }

.card-title {
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.8px;
  color:var(--text-dim);
  margin-bottom:16px;
  display:flex;
  align-items:center;
  gap:7px;
}
.card-title::before {
  content:'';
  width:3px;
  height:12px;
  background:var(--gold);
  border-radius:2px;
  flex-shrink:0;
}

/* Gold accent card */
.card-gold {
  border-color:var(--gold-border);
  background:linear-gradient(135deg,var(--card),rgba(212,175,55,0.03));
}
.card-green {
  border-color:var(--green-border);
}

/* ─── FORM ───────────────────────────────────────────── */
.form-grid { display:grid; gap:14px; }
.form-grid.cols-2 { grid-template-columns:1fr 1fr; }
.form-grid.cols-3 { grid-template-columns:1fr 1fr 1fr; }
.form-field { display:flex; flex-direction:column; gap:6px; }
.form-field.span-2 { grid-column:span 2; }
.form-field.span-3 { grid-column:span 3; }

label {
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.6px;
  color:var(--text-dim);
}
label.lbl-bright { color:var(--text); }

/* ─── ENERGY CHART ────────────────────────────────── */
.energy-chart-wrap {
  margin-top:20px;
  padding:18px 16px 12px;
  background:var(--bg-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
}
.energy-chart-title {
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.6px;
  color:var(--text-dim);
  margin-bottom:14px;
}
.energy-chart-legend {
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:10px;
  font-size:11px;
  color:var(--text-dim);
}
.legend-dot { width:8px; height:8px; border-radius:50%; display:inline-block; flex-shrink:0; }

/* ─── TELEGRAM SECTION ────────────────────────────── */
.telegram-section {
  margin-top:20px;
  padding-top:18px;
  border-top:1px solid var(--border);
}
.telegram-section-title {
  font-size:13px;
  font-weight:700;
  color:var(--text);
  margin-bottom:14px;
  display:flex;
  align-items:center;
  gap:8px;
}
.telegram-status {
  font-size:11px;
  padding:3px 10px;
  border-radius:20px;
  font-weight:600;
}
.telegram-status.ok { background:var(--green-dim); color:var(--green-light); border:1px solid var(--green-border); }
.telegram-status.off { background:var(--bg-2); color:var(--text-dim); border:1px solid var(--border); }
.telegram-send-btn {
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
}

/* ─── PROTOCOL LIBRARY ────────────────────────────── */
.protocol-library-wrap {
  margin-top:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.protocol-item {
  background:var(--bg-2);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 14px;
  display:flex;
  align-items:flex-start;
  gap:10px;
}
.protocol-item-content { flex:1; min-width:0; }
.protocol-item-name {
  font-size:13px;
  font-weight:600;
  color:var(--text);
  margin-bottom:3px;
}
.protocol-item-preview {
  font-size:11.5px;
  color:var(--text-dim);
  line-height:1.5;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.protocol-item-meta { font-size:10px; color:var(--text-dim); margin-top:4px; }
.protocol-item-actions { display:flex; gap:6px; flex-shrink:0; }

input,textarea,select {
  background:var(--bg-2);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  padding:10px 14px;
  font-size:13px;
  outline:none;
  width:100%;
  font-family:'Inter',sans-serif;
}
input:focus,textarea:focus,select:focus {
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(212,175,55,0.08);
}
input::placeholder,textarea::placeholder { color:var(--text-dim); }
textarea { resize:vertical; min-height:120px; line-height:1.7; }
.textarea-lg { min-height:280px; }
select option { background:var(--bg); color:var(--text); }

/* ─── ENERGY RATING ──────────────────────────────────── */
.energy-row {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:4px;
}
.energy-field { display:flex; flex-direction:column; gap:6px; }
.energy-label-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.energy-val {
  font-family:'Playfair Display',serif;
  font-size:20px;
  font-weight:700;
  color:var(--gold-light);
  line-height:1;
}
.energy-slider {
  -webkit-appearance:none;
  width:100%;
  height:5px;
  border-radius:3px;
  outline:none;
  cursor:pointer;
  background:linear-gradient(to right,var(--green) 0%,var(--gold) 50%,#C0392B 100%);
  border:none;
  padding:0;
  min-height:auto;
  box-shadow:none;
}
.energy-slider:focus { box-shadow:none; border:none; }
.energy-slider::-webkit-slider-thumb {
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--gold);
  cursor:pointer;
  border:2px solid var(--bg);
  box-shadow:0 0 8px rgba(212,175,55,0.4);
}

/* ─── SESSION CARDS ──────────────────────────────────── */
.sessions-grid { display:grid; gap:10px; }

.session-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:15px 18px;
  cursor:pointer;
  transition:all 0.15s;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.session-card:hover {
  background:var(--card-hover);
  border-color:var(--gold-border);
  transform:translateY(-1px);
  box-shadow:var(--shadow);
}
.session-card-left { display:flex; align-items:center; gap:14px; }

.session-number-badge {
  width:42px;
  height:42px;
  background:var(--green-dim);
  border:1px solid var(--green-border);
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:'Playfair Display',serif;
  font-size:20px;
  font-weight:700;
  color:var(--green-light);
  flex-shrink:0;
}

.session-card-title { font-size:13.5px; font-weight:600; color:var(--text); }
.session-card-meta { font-size:11px; color:var(--text-dim); margin-top:2px; }
.session-card-right { display:flex; align-items:center; gap:8px; flex-shrink:0; flex-wrap:wrap; justify-content:flex-end; }

/* Belief tags on session card */
.session-tags {
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:5px;
}
.belief-tag {
  padding:2px 8px;
  border-radius:20px;
  font-size:10px;
  font-weight:600;
  background:var(--green-dim);
  color:var(--green-light);
  border:1px solid var(--green-border);
}

/* Energy delta badge */
.energy-delta {
  display:flex;
  align-items:center;
  gap:3px;
  font-size:11px;
  font-weight:600;
  padding:2px 7px;
  border-radius:20px;
  background:var(--card-hover);
  border:1px solid var(--border);
  color:var(--text-dim);
}
.energy-delta.up { color:var(--success); background:rgba(64,145,108,0.1); border-color:rgba(64,145,108,0.25); }
.energy-delta.down { color:var(--danger); background:var(--danger-dim); border-color:rgba(181,52,30,0.25); }

.badge { padding:3px 10px; border-radius:20px; font-size:10.5px; font-weight:600; }
.badge-analysis    { background:var(--gold-dim); color:var(--gold-light); border:1px solid var(--gold-border); }
.badge-pending     { background:var(--card); color:var(--text-dim); border:1px solid var(--border); }
.badge-ready       { background:rgba(45,106,79,0.15); color:var(--green-light); border:1px solid var(--green-border); }
.badge-paid        { background:rgba(46,204,113,0.12); color:#2ecc71; border:1px solid rgba(46,204,113,0.30); }
.badge-pending-pay { background:rgba(231,76,60,0.10); color:#e74c3c; border:1px solid rgba(231,76,60,0.28); }

/* ─── PATIENT STRIP ──────────────────────────────────── */
.patient-strip {
  display:flex;
  align-items:center;
  gap:16px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px 20px;
  margin-bottom:20px;
}

.patient-avatar {
  width:44px;
  height:44px;
  background:linear-gradient(135deg,var(--green),var(--gold));
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:'Playfair Display',serif;
  font-size:20px;
  font-weight:700;
  flex-shrink:0;
  color:#fff;
  box-shadow:0 0 16px rgba(212,175,55,0.2);
}

.patient-strip-name { font-size:15px; font-weight:600; color:var(--text); }
.patient-strip-meta { font-size:11.5px; color:var(--text-dim); margin-top:2px; }
.patient-strip-actions { margin-left:auto; display:flex; gap:8px; }

/* ─── TRANSCRIPT ─────────────────────────────────────── */
.transcript-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:8px;
}

.record-btn {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 13px;
  border-radius:var(--radius-sm);
  font-size:11.5px;
  font-weight:600;
  border:1px solid var(--border);
  cursor:pointer;
  background:var(--card);
  color:var(--text-dim);
  transition:all 0.15s;
}
.record-btn:hover { border-color:var(--danger); color:var(--danger); }
.record-btn.recording { background:var(--danger-dim); border-color:var(--danger); color:var(--danger); }

.dot {
  width:7px; height:7px;
  border-radius:50%;
  background:var(--danger);
}
.record-btn.recording .dot { animation:blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

.transcript-status { font-size:11px; color:var(--text-dim); margin-top:4px; min-height:16px; }
.char-count { font-size:11px; color:var(--text-dim); text-align:right; margin-top:4px; }

/* ─── SESSION TIMER ──────────────────────────────────── */
.session-timer {
  position:fixed;
  bottom:28px;
  right:28px;
  background:var(--surface);
  border:1px solid var(--gold-border);
  border-radius:var(--radius);
  padding:12px 16px;
  z-index:50;
  box-shadow:var(--shadow-lg), var(--shadow-gold);
  display:flex;
  align-items:center;
  gap:12px;
  min-width:180px;
}
.session-timer.hidden { display:none !important; }
.timer-display {
  font-family:'Playfair Display',serif;
  font-size:28px;
  font-weight:600;
  color:var(--gold-light);
  line-height:1;
  letter-spacing:0.05em;
  min-width:80px;
}
.timer-controls { display:flex; gap:6px; }
.timer-btn {
  width:28px;
  height:28px;
  border-radius:var(--radius-xs);
  border:1px solid var(--border-2);
  background:var(--card);
  color:var(--text-dim);
  font-size:13px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all 0.15s;
}
.timer-btn:hover { background:var(--card-hover); color:var(--text); }
.timer-btn.active { border-color:var(--gold-border); color:var(--gold); background:var(--gold-dim); }
.timer-main-row { display:flex; align-items:center; gap:12px; }
.timer-hint { font-size:9px; color:var(--text-dim); text-align:center; margin-top:4px; opacity:0.6; letter-spacing:0.3px; }
.timer-phase-row {
  display:flex; justify-content:space-between; align-items:center;
  margin-top:6px; padding-top:6px; border-top:1px solid var(--border);
}
.timer-phase-name { font-size:11px; font-weight:600; color:var(--gold); }
.timer-phase-num  { font-size:10px; color:var(--text-dim); }
.timer-phase-bar  { height:3px; background:var(--border); border-radius:2px; margin-top:4px; overflow:hidden; }
.timer-phase-progress { height:100%; background:var(--gold); border-radius:2px; transition:width 1s linear; }
.timer-phases-config {
  border-top:1px solid var(--border);
  padding-top:10px; margin-top:8px; min-width:220px;
}
.timer-phases-header {
  display:flex; justify-content:space-between; align-items:center;
  font-size:11px; font-weight:600; color:var(--text-dim); margin-bottom:8px;
}
.timer-phases-toggle { display:flex; align-items:center; gap:5px; cursor:pointer; font-weight:400; }
.timer-phase-item {
  display:flex; gap:6px; align-items:center; margin-bottom:5px;
}
.timer-phase-item input[type="text"] {
  flex:1; background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius-xs); color:var(--text); padding:3px 7px; font-size:11px;
}
.timer-phase-item input[type="number"] {
  width:44px; background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius-xs); color:var(--text); padding:3px 7px;
  font-size:11px; text-align:center;
}
.timer-phase-item .timer-btn { width:22px; height:22px; font-size:11px; flex-shrink:0; }
@keyframes timerPulse { 0%,100%{border-color:var(--gold-border)} 50%{border-color:var(--gold);box-shadow:0 0 16px rgba(212,175,55,0.4)} }
.session-timer.phase-alert { animation:timerPulse 0.6s ease 3; }

/* ─── QUICK NOTES ────────────────────────────────────── */
.quick-notes {
  position:fixed;
  bottom:28px;
  right:220px;
  width:290px;
  background:var(--surface);
  border:1px solid var(--gold-border);
  border-radius:var(--radius);
  z-index:50;
  box-shadow:var(--shadow-lg), var(--shadow-gold);
  display:flex;
  flex-direction:column;
}
.quick-notes.hidden { display:none !important; }
.quick-notes-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px 8px;
  border-bottom:1px solid var(--border);
  cursor:grab;
  user-select:none;
}
.quick-notes-header:active { cursor:grabbing; }
.quick-notes-title { font-size:12px; font-weight:600; color:var(--gold); letter-spacing:0.05em; }
.quick-notes textarea {
  width:100%;
  height:150px;
  background:transparent;
  border:none;
  outline:none;
  resize:none;
  padding:12px 14px;
  font-size:12.5px;
  line-height:1.6;
  color:var(--text-soft);
  font-family:inherit;
  box-sizing:border-box;
}
.quick-notes-footer {
  display:flex;
  gap:6px;
  padding:8px 14px 12px;
  border-top:1px solid var(--border);
}

/* ─── ANALYSIS CARD ──────────────────────────────────── */
.analysis-card { border-color:var(--gold-border); }

.analysis-card-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
  flex-wrap:wrap;
}
.analysis-card-title {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  font-weight:700;
  color:var(--text);
}
.analysis-icon { font-size:18px; }

.analysis-model-badge {
  background:var(--green-dim);
  color:var(--green-light);
  border:1px solid var(--green-border);
  border-radius:20px;
  padding:2px 10px;
  font-size:10.5px;
  font-weight:600;
  display:none;
}
.analysis-card-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.analysis-date { font-size:11px; color:var(--text-dim); }
.analysis-tokens { font-size:11px; color:var(--text-dim); text-align:right; margin-top:10px; display:none; }

.analysis-state {
  text-align:center;
  padding:32px 16px;
  color:var(--text-dim);
}
.analysis-state-icon { font-size:34px; margin-bottom:12px; }
.analysis-state p { font-size:13px; line-height:1.65; }

.analysis-loading {
  display:flex;
  align-items:center;
  gap:20px;
  padding:28px 16px;
}
.analysis-orb {
  width:44px;
  height:44px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--green),var(--gold));
  animation:orb-pulse 1.5s ease-in-out infinite;
  flex-shrink:0;
}
@keyframes orb-pulse {
  0%,100% { transform:scale(1); box-shadow:0 0 20px rgba(212,175,55,0.3); }
  50%      { transform:scale(1.15); box-shadow:0 0 40px rgba(212,175,55,0.6); }
}

.analysis-content { line-height:1.78; font-size:13.5px; color:var(--text); }

.analysis-content h2 {
  font-family:'Playfair Display',serif;
  font-size:22px;
  font-weight:700;
  color:var(--gold-light);
  margin:28px 0 12px;
  padding-bottom:7px;
  border-bottom:1px solid var(--border);
  letter-spacing:-0.01em;
}
.analysis-content h2:first-child { margin-top:0; }
.analysis-content h3 { font-size:16px; font-weight:700; color:var(--text); margin:18px 0 7px; }
.analysis-content h4 { font-size:14px; font-weight:700; color:var(--text-soft); margin:14px 0 5px; text-transform:uppercase; letter-spacing:0.4px; }
.analysis-content p { margin-bottom:10px; color:var(--text-soft); }
.analysis-content strong { color:var(--text); font-weight:700; }
.analysis-content ul,.analysis-content ol { padding-left:20px; margin-bottom:10px; }
.analysis-content li { margin-bottom:5px; color:var(--text-soft); }
.analysis-content li strong { color:var(--text); }
.analysis-content hr { border:none; border-top:1px solid var(--border); margin:20px 0; }
.analysis-content em { color:var(--gold-light); font-style:italic; }

.streaming-cursor {
  display:inline-block;
  color:var(--gold);
  animation:blink 0.8s infinite;
  font-weight:300;
}

/* Tags extracted from analysis */
.extracted-tags {
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.extracted-tags-label {
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.6px;
  color:var(--text-dim);
  margin-right:4px;
}

/* ─── PRE-SESSION PREP ────────────────────────────────── */
.prep-card { border-color:var(--green-border); }
.prep-loading {
  display:flex;
  align-items:center;
  gap:16px;
  padding:20px;
}
.prep-orb {
  width:36px;
  height:36px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--green),var(--green-light));
  animation:orb-pulse 1.5s ease-in-out infinite;
  flex-shrink:0;
}

/* ─── BODY MAP ───────────────────────────────────────── */
.bm-card { padding:0; overflow:hidden; }

.bm-card-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  cursor:pointer;
  user-select:none;
  transition:background 0.15s;
}
.bm-card-header:hover { background:var(--card-hover); }

.bm-tag-count {
  font-size:10.5px;
  background:var(--green-dim);
  color:var(--green-light);
  border:1px solid var(--green-border);
  border-radius:20px;
  padding:2px 8px;
}

.bm-toggle-icon { color:var(--text-dim); font-size:17px; transition:transform 0.2s; }
.bm-toggle-icon.open { transform:rotate(90deg); }

#bmCardBody { padding:0 18px 18px; }

.bm-wrap { display:grid; grid-template-columns:210px 1fr; gap:18px; align-items:start; }
.bm-left { position:relative; }
.bm-svg { width:100%; max-width:190px; display:block; margin:0 auto; }

.bm-zone { cursor:pointer; transition:fill-opacity 0.2s,stroke 0.2s; }
.bm-zone:hover {
  fill:var(--gold) !important;
  fill-opacity:0.18 !important;
  stroke:var(--gold) !important;
  stroke-width:1.5 !important;
  stroke-opacity:0.7 !important;
}

.bm-right { padding-top:4px; }
.bm-right-title { font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.8px; color:var(--text-dim); margin-bottom:10px; }
.bm-hint { font-size:11px; color:var(--text-dim); margin-top:10px; line-height:1.5; }
.bm-list { display:flex; flex-direction:column; gap:7px; }
.bm-list-empty { font-size:12px; color:var(--text-dim); padding:8px 0; }

.bm-list-item {
  display:flex;
  align-items:flex-start;
  gap:9px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:9px 12px;
  cursor:pointer;
  transition:background 0.15s;
}
.bm-list-item:hover { background:var(--card-hover); }
.bm-list-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; margin-top:4px; }
.bm-list-info { flex:1; }
.bm-list-zone { font-size:13px; font-weight:600; margin-bottom:2px; }
.bm-list-em { font-size:12px; font-weight:600; }
.bm-list-notes { font-size:11px; color:var(--text-dim); margin-top:3px; line-height:1.4; }

.bm-pips { display:flex; gap:3px; align-items:center; flex-shrink:0; margin-top:4px; }
.bm-pip { width:6px; height:6px; border-radius:50%; background:var(--border); }

.bm-panel-overlay { position:fixed; inset:0; z-index:80; background:transparent; }
.bm-panel-overlay.hidden { display:none; }

.bm-panel {
  position:fixed;
  bottom:24px;
  right:24px;
  width:330px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  z-index:90;
}
.bm-panel.hidden { display:none; }
.bm-panel-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:13px 15px 11px;
  border-bottom:1px solid var(--border);
}
.bm-panel-zone { font-size:14px; font-weight:700; font-family:'Playfair Display',serif; }
.bm-panel-x { background:none; border:none; color:var(--text-dim); font-size:20px; cursor:pointer; line-height:1; }
.bm-panel-x:hover { color:var(--text); }

.bm-panel-body { padding:13px 15px; }
.bm-field-label {
  font-size:10.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:0.5px; color:var(--text-dim); margin-bottom:8px;
}
.bm-emotion-grid { display:flex; flex-wrap:wrap; gap:5px; }
.bm-etag {
  padding:4px 10px;
  border-radius:20px;
  font-size:11.5px;
  font-weight:600;
  cursor:pointer;
  border:1.5px solid color-mix(in srgb,var(--ec) 30%,transparent);
  background:color-mix(in srgb,var(--ec) 10%,transparent);
  color:var(--ec);
  transition:all 0.15s;
}
.bm-etag:hover { background:color-mix(in srgb,var(--ec) 20%,transparent); }
.bm-etag.sel {
  background:color-mix(in srgb,var(--ec) 25%,transparent);
  border-color:var(--ec);
  box-shadow:0 0 8px color-mix(in srgb,var(--ec) 40%,transparent);
}

.bm-range {
  width:100%;
  accent-color:var(--gold);
  margin:4px 0;
  background:transparent;
  border:none;
  padding:0;
}
.bm-textarea {
  width:100%;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  padding:8px 10px;
  font-size:12px;
  font-family:'Inter',sans-serif;
  resize:none;
  outline:none;
  line-height:1.5;
}
.bm-textarea:focus { border-color:var(--gold); }
.bm-panel-foot {
  display:flex; gap:8px; justify-content:flex-end;
  padding:11px 15px; border-top:1px solid var(--border);
}

/* ─── BUSINESS VIEW ──────────────────────────────────── */
.biz-section { margin-bottom:24px; }
.biz-section-title { font-size:10.5px; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.1em; margin-bottom:12px; }
.biz-kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:20px; }
.biz-kpi {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:16px;
  text-align:center;
}
.biz-kpi-value { font-size:32px; font-weight:700; color:var(--gold); font-family:'Playfair Display',serif; line-height:1; margin-bottom:4px; }
.biz-kpi-label { font-size:11px; color:var(--text-dim); }
.biz-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.biz-table th { text-align:left; padding:8px 12px; border-bottom:2px solid var(--border); color:var(--text-dim); font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; }
.biz-table td { padding:10px 12px; border-bottom:1px solid var(--border); color:var(--text-soft); }
.biz-table tr:last-child td { border-bottom:none; }
.biz-table tr:hover td { background:var(--card-hover); }
.biz-bar-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.biz-bar-label { font-size:12px; color:var(--text-soft); width:120px; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.biz-bar-wrap { flex:1; height:8px; background:var(--border); border-radius:4px; overflow:hidden; }
.biz-bar-fill { height:100%; background:var(--gold); border-radius:4px; transition:width 0.5s ease; }
.biz-bar-val { font-size:11px; color:var(--gold); font-weight:600; min-width:40px; text-align:right; }
@media (max-width:700px) { .biz-kpi-grid { grid-template-columns:repeat(2,1fr); } }

/* ─── EVOLUTION DASHBOARD ────────────────────────────── */
.evolution-dashboard { margin-bottom:20px; }
.evo-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.evo-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:14px 16px;
}
.evo-card-title { font-size:10.5px; font-weight:600; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:8px; }
.evo-card-value { font-size:28px; font-weight:700; color:var(--gold); font-family:'Playfair Display',serif; line-height:1; margin-bottom:4px; }
.evo-card-sub { font-size:11px; color:var(--text-dim); }
.evo-beliefs { background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px 16px; margin-bottom:12px; }
.evo-beliefs-title { font-size:10.5px; font-weight:600; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:10px; }
.evo-belief-row { display:flex; align-items:center; gap:10px; margin-bottom:7px; }
.evo-belief-name { font-size:12px; color:var(--text-soft); flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.evo-belief-bar-wrap { flex:2; height:5px; background:var(--border); border-radius:3px; overflow:hidden; }
.evo-belief-bar { height:100%; background:var(--gold); border-radius:3px; }
.evo-belief-cnt { font-size:11px; color:var(--gold); font-weight:600; min-width:20px; text-align:right; }
.evo-milestones { background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px 16px; }
.evo-milestones-title { font-size:10.5px; font-weight:600; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:10px; }
.evo-milestone { display:flex; align-items:center; gap:10px; margin-bottom:7px; font-size:12px; color:var(--text-soft); }
.evo-milestone-dot { width:8px; height:8px; border-radius:50%; background:var(--gold); flex-shrink:0; }

/* ─── GOALS ──────────────────────────────────────────── */
.goals-section { margin-bottom:20px; }
.goals-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.goals-list { display:flex; flex-direction:column; gap:10px; }
.goals-empty { font-size:13px; color:var(--text-dim); text-align:center; padding:12px 0; }
.goal-item {
  background:var(--bg-2);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 14px;
}
.goal-item-header { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.goal-name-input {
  flex:1; background:transparent; border:none; outline:none;
  color:var(--text); font-size:13px; font-weight:500;
}
.goal-name-input::placeholder { color:var(--text-dim); }
.goal-progress-row { display:flex; align-items:center; gap:10px; }
.goal-progress-bar { flex:1; height:6px; background:var(--border); border-radius:4px; overflow:hidden; }
.goal-progress-fill { height:100%; background:var(--gold); border-radius:4px; transition:width 0.3s; }
.goal-pct { font-size:11px; color:var(--gold); font-weight:600; min-width:32px; text-align:right; }
.goal-del {
  background:none; border:none; color:var(--text-muted);
  cursor:pointer; font-size:14px; padding:2px 6px;
}
.goal-del:hover { color:var(--danger); }

/* ─── PATIENT CHAT ───────────────────────────────────── */
.patient-chat-section { margin-bottom:20px; }
.patient-chat-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.patient-chat-suggestions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.chat-suggestion-chip {
  background:var(--gold-dim); border:1px solid var(--gold-border);
  color:var(--gold); border-radius:20px; padding:5px 13px;
  font-size:12px; cursor:pointer; transition:background 0.15s; font-family:inherit;
}
.chat-suggestion-chip:hover { background:rgba(212,175,55,0.18); }
.patient-chat-messages {
  max-height:380px; overflow-y:auto;
  display:flex; flex-direction:column; gap:12px;
  margin-bottom:14px; padding-right:4px;
}
.patient-chat-messages:empty { display:none; }
.chat-msg { display:flex; gap:10px; }
.chat-msg.user { flex-direction:row-reverse; }
.chat-bubble {
  max-width:78%; padding:10px 14px; font-size:13.5px; line-height:1.55;
}
.chat-msg.user .chat-bubble {
  background:var(--gold-dim); border:1px solid var(--gold-border);
  color:var(--text-soft); border-radius:14px 14px 4px 14px;
}
.chat-msg.ai .chat-bubble {
  background:var(--surface); border:1px solid var(--border);
  color:var(--text-soft); border-radius:14px 14px 14px 4px;
}
.chat-msg.ai .chat-bubble h1,.chat-msg.ai .chat-bubble h2,.chat-msg.ai .chat-bubble h3 { font-size:13px; margin:8px 0 4px; color:var(--gold); }
.chat-msg.ai .chat-bubble p { margin-bottom:6px; }
.chat-msg.ai .chat-bubble ul,.chat-msg.ai .chat-bubble ol { padding-left:16px; margin-bottom:6px; }
.chat-msg.ai .chat-bubble li { margin-bottom:3px; }
.chat-msg.ai .chat-bubble strong { color:var(--text); }
.chat-msg-avatar {
  width:28px; height:28px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; flex-shrink:0; margin-top:3px;
}
.chat-msg.user .chat-msg-avatar { background:var(--gold-dim); border:1px solid var(--gold-border); }
.chat-msg.ai .chat-msg-avatar { background:var(--surface); border:1px solid var(--border); }
.chat-typing { display:flex; gap:4px; align-items:center; padding:6px 2px; }
.chat-typing span { width:7px; height:7px; border-radius:50%; background:var(--gold); opacity:0.4; animation:chatDot 1.2s infinite; }
.chat-typing span:nth-child(2) { animation-delay:0.2s; }
.chat-typing span:nth-child(3) { animation-delay:0.4s; }
@keyframes chatDot { 0%,80%,100%{opacity:0.2;transform:scale(0.8)} 40%{opacity:1;transform:scale(1)} }
.patient-chat-input { display:flex; gap:8px; align-items:flex-end; }
.patient-chat-input textarea {
  flex:1; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text); padding:9px 12px;
  font-size:13.5px; font-family:inherit; resize:none; transition:border-color 0.15s;
}
.patient-chat-input textarea:focus { outline:none; border-color:var(--gold-border); }

/* ─── INTER-SESSION NOTES ────────────────────────────── */
.internotes-section { margin-bottom:20px; }
.internotes-add {
  display:flex;
  gap:8px;
  margin-bottom:12px;
}
.internotes-add input { flex:1; }
.internotes-list { display:flex; flex-direction:column; gap:7px; }
.internote-item {
  display:flex;
  align-items:flex-start;
  gap:10px;
  background:var(--bg-2);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:10px 14px;
}
.internote-text { flex:1; font-size:13px; color:var(--text-soft); line-height:1.55; }
.internote-date { font-size:10.5px; color:var(--text-dim); margin-top:3px; }
.internote-del {
  background:none; border:none; color:var(--text-muted);
  font-size:16px; cursor:pointer; line-height:1;
  padding:0 2px; flex-shrink:0; margin-top:2px;
  transition:color 0.15s;
}
.internote-del:hover { color:var(--danger); }
.internote-empty { font-size:12px; color:var(--text-dim); padding:8px 0; }

/* ─── CALENDAR ───────────────────────────────────────── */
.calendar-wrap { padding:22px 30px; }
.calendar-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:20px;
}
.calendar-month {
  font-family:'Playfair Display',serif;
  font-size:28px;
  font-weight:600;
  letter-spacing:-0.02em;
  color:var(--text);
}
.calendar-nav { display:flex; gap:8px; }

.calendar-grid {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:6px;
}
.calendar-weekday {
  text-align:center;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.8px;
  color:var(--text-dim);
  padding:6px 0;
}
.calendar-day {
  aspect-ratio:1;
  border-radius:var(--radius-sm);
  border:1px solid var(--border);
  background:var(--card);
  cursor:pointer;
  padding:6px;
  transition:all 0.15s;
  display:flex;
  flex-direction:column;
  gap:3px;
  min-height:70px;
  position:relative;
}
.calendar-day:hover { border-color:var(--gold-border); background:var(--card-hover); }
.calendar-day.empty { border-color:transparent; background:transparent; cursor:default; }
.calendar-day.today { border-color:var(--gold-border); background:var(--gold-dim); }
.calendar-day.has-session { border-color:var(--green-border); }

.cal-day-num {
  font-size:12px;
  font-weight:600;
  color:var(--text-dim);
  line-height:1;
}
.calendar-day.today .cal-day-num { color:var(--gold-light); font-weight:700; }

.cal-session-dot {
  font-size:10px;
  padding:1px 5px;
  border-radius:4px;
  background:var(--green-dim);
  color:var(--green-light);
  display:flex;
  align-items:center;
  gap:2px;
  border:1px solid var(--green-border);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:pointer;
  transition:background 0.15s;
  line-height:1.4;
}
.cal-session-dot:hover { background:var(--green-border); }
.cal-session-dot.future {
  background:var(--gold-dim);
  color:var(--gold-light);
  border-color:var(--gold-border);
}
.cal-dot-delete {
  opacity:0; font-size:12px; line-height:1; cursor:pointer;
  color:var(--danger); padding:0 2px; border-radius:2px;
  transition:opacity 0.15s;
  flex-shrink:0;
}
.cal-session-dot:hover .cal-dot-delete { opacity:1; }

/* Add session on calendar day */
.cal-add-btn {
  position:absolute;
  bottom:4px;
  right:4px;
  width:18px;
  height:18px;
  border-radius:4px;
  background:transparent;
  border:1px solid var(--border-2);
  color:var(--text-muted);
  font-size:12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transition:all 0.15s;
}
.calendar-day:hover .cal-add-btn { opacity:1; color:var(--gold); border-color:var(--gold-border); }

/* ─── EVOLUTION TIMELINE ─────────────────────────────── */
.evolution-timeline-wrap { margin-bottom:16px; }
.evolution-timeline {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px 18px;
}
.timeline-label {
  font-size:10.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:1px; color:var(--text-dim); margin-bottom:12px;
}
.timeline-track { display:flex; align-items:center; gap:0; flex-wrap:wrap; row-gap:10px; }
.timeline-item { display:flex; flex-direction:column; align-items:center; gap:4px; cursor:pointer; position:relative; }
.timeline-item:hover .timeline-dot { border-color:var(--gold); background:var(--gold-dim); }
.timeline-dot {
  width:34px; height:34px; border-radius:50%;
  border:2px solid var(--border-2); background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  font-family:'Playfair Display',serif;
  font-size:14px; font-weight:700; color:var(--text-dim); transition:all 0.15s;
}
.timeline-item.has-transcript .timeline-dot {
  border-color:var(--green-light); background:var(--green-dim); color:var(--green-light);
}
.timeline-date { font-size:10px; color:var(--text-dim); white-space:nowrap; }
.timeline-badge {
  position:absolute; top:-3px; right:-3px;
  width:13px; height:13px; background:var(--success);
  border-radius:50%; font-size:8px;
  display:flex; align-items:center; justify-content:center; color:#fff;
}
.timeline-connector { width:24px; height:2px; background:var(--border); margin-bottom:16px; flex-shrink:0; }

/* ─── QUICK SHARE ────────────────────────────────────── */
.share-box {
  background:var(--bg-2);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:14px 16px;
  font-size:13px;
  line-height:1.6;
  color:var(--text-soft);
  white-space:pre-wrap;
  font-style:italic;
}

/* ─── MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.85);
  z-index:100; display:flex; align-items:center; justify-content:center; padding:24px;
}
.modal-overlay.hidden { display:none; }

.modal {
  background:var(--surface);
  border:1px solid var(--border-2);
  border-radius:var(--radius);
  width:100%;
  max-width:760px;
  max-height:90vh;
  display:flex;
  flex-direction:column;
  box-shadow:var(--shadow-lg);
}
.modal-sm .modal { max-width:520px; }
.modal-lg .modal { max-width:780px; }

/* ─── INTAKE INSTRUCTION ─────────────────────────────── */
.intake-instruction {
  background: rgba(212,175,55,0.08);
  border: 1px solid var(--gold-border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ─── QUESTIONNAIRE ──────────────────────────────────── */
.quest-tabs { display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.quest-tab {
  padding:7px 16px; border-radius:20px; border:1px solid var(--border);
  background:var(--card); color:var(--text-dim); font-size:12px; cursor:pointer; transition:all 0.15s;
}
.quest-tab.active { background:var(--gold-dim); border-color:var(--gold-border); color:var(--gold); font-weight:600; }
.quest-tab:hover:not(.active) { border-color:var(--border-2); color:var(--text-soft); }
.quest-form { display:flex; flex-direction:column; gap:16px; }
.quest-question { display:flex; flex-direction:column; gap:6px; }
.quest-q-label { font-size:13px; font-weight:500; color:var(--text-soft); line-height:1.5; }
.quest-q-label strong { color:var(--gold); }
.quest-answer {
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  padding:10px 14px;
  font-size:13px;
  line-height:1.6;
  resize:vertical;
  min-height:80px;
  font-family:'Inter',sans-serif;
  outline:none;
  transition:border-color 0.15s;
  width:100%;
  box-sizing:border-box;
}
.quest-answer:focus { border-color:var(--gold); }

/* ─── BELIEF PROTOCOL POPUP ──────────────────────────── */
.belief-popup {
  position:fixed;
  bottom:28px;
  left:50%;
  transform:translateX(-50%);
  width:380px;
  max-width:calc(100vw - 40px);
  background:var(--surface);
  border:1px solid var(--gold-border);
  border-radius:var(--radius);
  z-index:60;
  box-shadow:var(--shadow-lg), var(--shadow-gold);
  padding:0;
  display:flex;
  flex-direction:column;
}
.belief-popup.hidden { display:none !important; }
.belief-popup-header {
  display:flex; align-items:center; gap:8px;
  padding:12px 14px 10px; border-bottom:1px solid var(--border);
}
.belief-popup-tag {
  font-size:13px; font-weight:600;
  color:var(--gold); letter-spacing:0.02em;
}
.belief-popup-count {
  font-size:10px; color:var(--text-dim);
  background:var(--card); border:1px solid var(--border);
  border-radius:10px; padding:2px 8px;
}
.belief-popup-section {
  font-size:10.5px; font-weight:600; color:var(--text-dim);
  text-transform:uppercase; letter-spacing:0.08em;
  padding:10px 14px 6px;
}
.belief-popup-area {
  width:100%; min-height:110px; resize:vertical;
  background:transparent; border:none; outline:none;
  color:var(--text-soft); font-size:12.5px; line-height:1.65;
  font-family:'Inter',sans-serif; padding:0 14px 10px;
  box-sizing:border-box;
}
.belief-popup-footer {
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 14px 12px; border-top:1px solid var(--border);
}
.belief-popup-hint { font-size:10px; color:var(--text-dim); }
.belief-tag.clickable { cursor:pointer; transition:all 0.15s; }
.belief-tag.clickable:hover { background:var(--gold-dim); border-color:var(--gold); color:var(--gold-bright); }

.modal-header {
  padding:20px 24px 16px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.modal-title {
  font-family:'Playfair Display',serif;
  font-size:20px;
  font-weight:600;
  letter-spacing:-0.02em;
  color:var(--text);
}
.modal-subtitle { font-size:12px; color:var(--text-dim); margin-top:3px; }
.modal-close {
  background:none; border:none; color:var(--text-dim);
  font-size:20px; cursor:pointer; line-height:1; flex-shrink:0;
}
.modal-close:hover { color:var(--text); }
.modal-body { padding:20px 24px; overflow-y:auto; flex:1; }
.modal-footer {
  padding:14px 24px; border-top:1px solid var(--border);
  display:flex; gap:8px; justify-content:flex-end;
}

/* ─── ALERT ──────────────────────────────────────────── */
.alert {
  position:fixed; top:24px; right:24px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 18px; font-size:13px;
  z-index:200; box-shadow:var(--shadow-lg);
  display:flex; align-items:center; gap:10px;
  animation:slideIn 0.25s ease; max-width:340px;
}
.alert.success { border-color:var(--green-border); color:var(--success); }
.alert.error { border-color:rgba(192,57,43,0.3); color:var(--danger); }
.alert.hidden { display:none; }
@keyframes slideIn { from{transform:translateX(24px) scale(0.95);opacity:0} to{transform:translateX(0) scale(1);opacity:1} }

/* ─── CONFIRM ────────────────────────────────────────── */
.confirm-dialog {
  position:fixed; inset:0; background:rgba(0,0,0,0.8);
  z-index:150; display:flex; align-items:center; justify-content:center;
}
.confirm-dialog.hidden { display:none; }
.confirm-box {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:28px; max-width:380px; text-align:center; box-shadow:var(--shadow-lg);
}
.confirm-box h3 { font-family:'Playfair Display',serif; font-size:22px; font-weight:600; margin-bottom:8px; }
.confirm-box p { font-size:13px; color:var(--text-dim); margin-bottom:24px; line-height:1.55; }
.confirm-box .btn-row { display:flex; gap:8px; justify-content:center; }

/* ─── MISC ───────────────────────────────────────────── */
.divider { height:1px; background:var(--border); margin:20px 0; }
.section-label {
  font-size:10.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:1px; color:var(--text-dim); margin-bottom:10px;
}
.empty-state { text-align:center; padding:48px 24px; color:var(--text-dim); }
.empty-state .empty-icon { font-size:38px; margin-bottom:12px; }
.empty-state p { font-size:13px; }
.save-status { font-size:11px; color:var(--success); display:flex; align-items:center; gap:4px; }
.save-status.hidden { opacity:0; }

/* Settings */
.api-help-box {
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:14px 16px; font-size:12.5px; color:var(--text-dim); line-height:1.7;
}
.api-help-box strong { color:var(--gold-light); }
.settings-test-row { display:flex; align-items:center; gap:12px; margin-top:14px; }
#testKeyResult { font-size:13px; font-weight:600; }

.analysis-info {
  background:var(--gold-dim);
  border:1px solid var(--gold-border);
  border-radius:var(--radius-sm);
  padding:12px 16px; font-size:12.5px;
  color:var(--gold-light); margin-bottom:16px; line-height:1.6;
}
.analysis-prompt-box {
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:14px; font-size:11.5px; line-height:1.7;
  color:var(--text-dim); white-space:pre-wrap;
  font-family:'Courier New',monospace; max-height:360px; overflow-y:auto;
}

/* ─── PRINT / PDF ────────────────────────────────────── */
@media print {
  #sidebar,
  .page-header,
  .session-timer,
  .quick-notes,
  .bm-card,
  .btn,
  .analysis-card-actions,
  .transcript-toolbar,
  .record-btn,
  .char-count,
  .modal-overlay { display:none !important; }

  body { background:#fff; color:#000; font-size:11pt; overflow:visible; }
  #main { overflow:visible; }
  .card { border:1px solid #ddd; page-break-inside:avoid; margin-bottom:16px; }
  .analysis-content h2 { color:#043717; border-bottom:1px solid #ddd; }
  .analysis-content h3 { color:#065c27; }
  .analysis-content p,.analysis-content li { color:#333; }
  .page-title { font-size:20pt; color:#000; }
  .page-subtitle { color:#555; }
}

/* ─── THERAPIST PROFILE ──────────────────────────────── */
.profile-photo-area {
  display:flex; align-items:center; gap:16px; margin-bottom:20px;
}
.profile-avatar-large {
  width:64px; height:64px;
  background:linear-gradient(135deg,var(--green),var(--gold));
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:'Playfair Display',serif; font-size:28px; font-weight:700; color:#fff;
  box-shadow:0 0 20px rgba(212,175,55,0.2); flex-shrink:0;
}
.profile-avatar-large:hover .therapist-photo-hint { opacity:1 !important; }
.profile-info h3 {
  font-family:'Playfair Display',serif;
  font-size:20px; font-weight:600; color:var(--text); letter-spacing:-0.01em;
}
.profile-info p { font-size:12px; color:var(--text-dim); margin-top:3px; }

/* Modalities checklist */
.modality-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.modality-item {
  display:flex; align-items:center; gap:8px;
  padding:7px 10px; border-radius:var(--radius-sm);
  border:1px solid var(--border); cursor:pointer;
  transition:all 0.15s; font-size:12px; color:var(--text-dim);
  background:var(--bg-2);
}
.modality-item:hover { border-color:var(--border-2); color:var(--text-soft); }
.modality-item.sel { border-color:var(--green-border); background:var(--green-dim); color:var(--green-light); }
.modality-check {
  width:14px; height:14px; border-radius:3px;
  border:1.5px solid var(--border-2); background:transparent;
  display:flex; align-items:center; justify-content:center; font-size:10px;
  flex-shrink:0; transition:all 0.15s;
}
.modality-item.sel .modality-check { background:var(--green-light); border-color:var(--green-light); color:#fff; }
