/* ── Journal section reset ── */
/* Matches the therapist journal layout (therapist-dashboard/styles/02-tokens-and-shell.css:248)
   so the three modules — My Journal, Google Docs, Full Entry Log — each fill
   a fixed 78vh height instead of collapsing on flex chains that depend on an
   unset parent height. min-height: 520px prevents collapse on short screens. */
#section-journal.active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  gap: 0 !important;
  padding: 12px 16px 20px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Each module gets the same fixed vertical footprint */
#section-journal .journal-app,
#section-journal #cGdocsPanel.gdocs-active,
#section-journal .el-panel {
  flex: 0 0 auto !important;
  height: 78vh !important;
  min-height: 520px !important;
  overflow: hidden !important;
}

/* ── Journal tab bar ── */
.journal-tab-bar { display:flex; gap:12px; flex-shrink:0; border:1px solid var(--border); padding:10px 20px 10px; background:var(--card); border-radius:var(--radius-lg) var(--radius-lg) 0 0; }
.journal-tab { padding:9px 18px; border-radius:var(--radius-sm); border:none; background:transparent; cursor:pointer; font-size:13px; font-family:var(--sans); color:var(--muted); display:flex; align-items:center; gap:6px; transition:all 0.15s; }
.journal-tab:hover { background:var(--surface); color:var(--ink); }
.journal-tab.active { background:var(--accent); color:#fff; }

/* ── Journal 3-panel layout ── */
/* Column widths match therapist journal (290 / 1fr / 360). Height & flex
   are handled by the locked #section-journal .journal-app rule above. */
.journal-app {
  display: grid;
  grid-template-columns: 290px 1fr 360px;
  gap: 0;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--card);
  box-shadow: 0 4px 32px var(--shadow);
}

/* ── Entry sidebar ── */
.journal-sidebar { border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.sidebar-head { padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-head h3 { font-size: 14px; margin-bottom: 10px; font-weight: 600; letter-spacing: -0.01em; font-family: var(--sans); }
.new-entry-btn { width: 100%; background: var(--ink); color: #fff; border: none; border-radius: 0; padding: 9px; font-size: 12px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: opacity 0.2s; }
.new-entry-btn:hover { opacity: 0.8; }
.log-filters { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.log-filters label { margin-bottom: 2px; }
.log-filters input, .log-filters select { padding: 6px 9px; font-size: 11px; }
.entry-list { flex: 1; overflow-y: auto; padding: 7px; }
.entry-item { position: relative; padding: 10px 32px 10px 12px; border-radius: 0; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; transition: all 0.15s; border-left: 3px solid transparent; }
.entry-item:hover { background: var(--card); border-color: var(--border); border-left-color: var(--border); }
.entry-item.active { background: var(--card); border-color: var(--accent); border-left-color: var(--accent); }
.entry-item-date { font-size: 10px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.07em; }
.entry-item-preview { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; letter-spacing: -0.01em; }
.entry-item-meta { font-size: 11px; color: var(--muted); }
.entry-item-actions { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity 0.15s; }
.entry-item:hover .entry-item-actions, .entry-item.active .entry-item-actions { opacity: 1; pointer-events: auto; }
.entry-item.menu-open .entry-item-actions { opacity: 1; pointer-events: auto; }
.entry-menu-btn { background: none; border: none; cursor: pointer; width: 22px; height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--muted); padding: 0; line-height: 1; }
.entry-menu-btn:hover { background: var(--surface); color: var(--ink); }
.entry-rename-input { font-size: 12px; font-weight: 500; color: var(--ink); border: 1px solid var(--accent); border-radius: 4px; padding: 2px 5px; width: 100%; box-sizing: border-box; background: var(--card); outline: none; }
/* ── Portal entry context menu (fixed, escapes sidebar overflow clipping) ── */
.ss-entry-menu { position: fixed; background: var(--card); border: 1px solid var(--border); border-radius: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.14); z-index: 9999; min-width: 152px; padding: 4px 0; display: none; }
.ss-entry-menu.open { display: block; }
.ss-entry-menu .entry-menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; font-size: 12px; cursor: pointer; color: var(--ink); transition: background 0.1s; user-select: none; font-family: var(--sans); }
.ss-entry-menu .entry-menu-item:hover { background: var(--surface); }
.ss-entry-menu .entry-menu-item.danger { color: #c0392b; }
.ss-entry-menu .entry-menu-item.danger:hover { background: #fde8e6; }
#ssMenuOverlay { display: none; position: fixed; inset: 0; z-index: 9998; }
#ssMenuOverlay.open { display: block; }
/* ── Delete confirmation modal ── */
.ss-delete-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 10000; align-items: center; justify-content: center; }
.ss-delete-backdrop.open { display: flex; }
.ss-delete-modal { background: var(--card); border-radius: 0; padding: 32px 28px 28px; max-width: 380px; width: calc(100% - 48px); box-shadow: 0 12px 48px rgba(0,0,0,0.22); }
.ss-delete-modal-icon { font-size: 28px; color: #c0392b; margin-bottom: 14px; }
.ss-delete-modal h3 { font-size: 16px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; color: var(--ink); margin: 0 0 8px; }
.ss-delete-modal p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.ss-delete-modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.ss-delete-modal-btns .btn-cancel { padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 0; background: transparent; cursor: pointer; font-size: 13px; font-family: var(--sans); color: var(--muted); transition: all 0.15s; }
.ss-delete-modal-btns .btn-cancel:hover { border-color: var(--ink); color: var(--ink); }
.ss-delete-modal-btns .btn-delete { padding: 8px 18px; border: none; border-radius: 0; background: #c0392b; color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; font-family: var(--sans); transition: background 0.15s; }
.ss-delete-modal-btns .btn-delete:hover { background: #a93226; }
.no-entries { text-align: center; padding: 32px 16px; color: var(--muted); font-size: 12px; line-height: 1.8; }

/* ── Editor ── */
.editor-area { display: flex; flex-direction: column; overflow: hidden; background: var(--card); }
.editor-toolbar { padding: 12px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; min-height: 52px; }
.editor-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subject-input { background: transparent; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 5px 2px; font-size: 14px; font-weight: 500; color: var(--ink); width: 200px; }
.subject-input:focus { border-color: var(--accent); background: transparent; }
.editor-date-label { font-size: 11px; color: var(--muted); }
.editor-actions { display: flex; align-items: center; gap: 10px; }
.btn-save { background: var(--green); color: #fff; border: none; border-radius: 0; padding: 8px 18px; font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: opacity 0.2s; letter-spacing: 0; }
.btn-save:hover { opacity: 0.85; }
.btn-delete { background: none; color: var(--muted); border: 1px solid var(--border); border-radius: 0; padding: 8px 14px; font-size: 13px; font-family: var(--sans); cursor: pointer; transition: all 0.15s; letter-spacing: 0; }
.btn-delete:hover { color: var(--red); border-color: var(--red); }
.btn-dictate { background: none; color: var(--muted); border: 1px solid var(--border); border-radius: 0; width: 38px; height: 38px; padding: 0; font-size: 16px; line-height: 1; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-dictate:hover { color: var(--ink); border-color: var(--ink); }
/* Share-with-clinician button on the journal entry toolbar. */
.btn-share { background: none; color: var(--muted); border: 1px solid var(--border); border-radius: 0; padding: 8px 14px; font-size: 13px; font-family: var(--sans); cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-share:hover { color: var(--accent); border-color: var(--accent); }
.btn-share.shared { color: var(--green); border-color: var(--green); }
.btn-share i { font-size: 13px; }
/* "Clinician feedback" — visible only when a connected clinician
   has published a review on the active entry. Same shape as Share. */
.btn-feedback { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 0; padding: 8px 14px; font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-feedback:hover { opacity: 0.88; }
.btn-feedback i { font-size: 13px; }
/* "Mark up" — opens the entry in the markup viewer (journal-self mode)
   so the client can pen/highlight/pin on their own entry. */
.btn-markup { background: none; color: var(--muted); border: 1px solid var(--border); border-radius: 0; padding: 8px 14px; font-size: 13px; font-family: var(--sans); cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-markup:hover { color: var(--ink); border-color: var(--ink); }
.btn-markup i { font-size: 13px; }
/* Share modal — same backdrop pattern as the delete modal. */
.share-modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 10000; align-items: center; justify-content: center; padding: 20px; }
.share-modal-backdrop.open { display: flex; }
.share-modal { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 28px 30px; width: min(460px, 100%); box-shadow: 0 8px 40px rgba(0,0,0,0.25); }
.share-modal h3 { font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--ink); margin-bottom: 6px; letter-spacing: 0.02em; }
.share-modal .share-sub { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }
.share-modal .share-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-bottom: 18px; }
.share-modal .share-li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 0; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.share-modal .share-li:hover { border-color: var(--accent); background: var(--surface); }
.share-modal .share-li.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.share-modal .share-li.already { opacity: 0.7; cursor: default; }
.share-modal .share-li.already:hover { border-color: var(--border); background: var(--card); }
.share-modal .share-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 14px; color: var(--ink); flex-shrink: 0; overflow: hidden; }
.share-modal .share-avatar img { width: 100%; height: 100%; object-fit: cover; }
.share-modal .share-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.share-modal .share-name .sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.share-modal .share-state { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); flex-shrink: 0; }
.share-modal .share-li.selected .share-state { color: var(--accent); }
.share-modal .share-li.already .share-state { color: var(--green); }
.share-modal .share-empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.share-modal .share-empty i { font-size: 28px; opacity: 0.5; display: block; margin-bottom: 10px; }
.share-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.share-modal-actions .btn-cancel { background: none; border: 1px solid var(--border); color: var(--muted); padding: 9px 18px; font-size: 13px; font-family: var(--sans); cursor: pointer; border-radius: 0; }
.share-modal-actions .btn-cancel:hover { color: var(--ink); border-color: var(--ink); }
.share-modal-actions .btn-confirm { background: var(--ink); border: none; color: #fff; padding: 9px 22px; font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; border-radius: 0; }
.share-modal-actions .btn-confirm:hover { opacity: 0.88; }
.share-modal-actions .btn-confirm:disabled { opacity: 0.45; cursor: not-allowed; }
/* "Shared" pip on entries in the sidebar list. */
.entry-shared-pip { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); margin-left: 6px; font-weight: 500; }
.entry-shared-pip i { font-size: 9px; }
.btn-dictate.recording { color: #fff; background: #e05050; border-color: #e05050; animation: dictPulse 1.5s infinite; }
.btn-dictate.recording:hover { background: #c0392b; border-color: #c0392b; }
.btn-dictate .dictate-label { font-size: 11px; font-family: var(--sans); font-weight: 500; }
@keyframes dictPulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.saved-flash { font-size: 11px; color: var(--green); opacity: 0; transition: opacity 0.3s; }
.saved-flash.show { opacity: 1; }
/* editor-scroll: overflow hidden keeps the flex height chain intact.
   The textarea itself scrolls for long entries. */
.editor-scroll { flex: 1; min-height: 0; overflow: hidden; padding: 24px 32px 20px; display: flex; flex-direction: column; background: var(--card); }
#editorContent { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.empty-editor { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; color: var(--muted); gap: 10px; }
.empty-editor .icon { font-size: 36px; }
.empty-editor h3 { color: var(--ink); font-size: 20px; font-family: var(--serif); }
.empty-editor p { font-size: 13px; line-height: 1.7; max-width: 280px; }
.prompt-banner { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 12px 16px; margin-bottom: 16px; display: none; flex-shrink: 0; }
.prompt-banner.visible { display: flex; flex-direction: column; }
.prompt-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.prompt-label .prompt-dismiss { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 0; line-height: 1; opacity: 0.6; }
.prompt-label .prompt-dismiss:hover { opacity: 1; }
.prompt-text { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--ink); border: none; background: transparent; resize: none; outline: none; width: 100%; min-height: 28px; padding: 0; }
.prompt-text::placeholder { color: rgba(0,0,0,.25); font-style: italic; }
.prompt-save-btn { background: none; border: none; cursor: pointer; color: var(--accent); font-size: 11px; font-weight: 600; font-family: var(--sans); padding: 2px 8px; letter-spacing: 0.02em; opacity: 0.8; transition: opacity 0.15s; }
.prompt-save-btn:hover { opacity: 1; }
.prompt-saved-actions { display: flex; align-items: center; gap: 6px; }
.prompt-edit-btn { background: none; border: none; cursor: pointer; color: var(--accent); font-size: 11px; font-weight: 500; font-family: var(--sans); padding: 2px 6px; opacity: 0.6; transition: opacity 0.15s; }
.prompt-edit-btn:hover { opacity: 1; }
.prompt-saved-text { font-family: var(--serif); font-size: 15px; line-height: 1.6; color: var(--ink); margin: 0; font-style: italic; }
.prompt-toggle { background: none; border: 1px dashed var(--border); border-radius: 0; padding: 6px 12px; font-size: 12px; color: var(--muted); cursor: pointer; font-family: var(--sans); margin-bottom: 10px; display: none; transition: background 0.15s; }
.prompt-toggle:hover { background: var(--surface); }
.prompt-toggle.visible { display: inline-flex; align-items: center; gap: 5px; }
/* ── Highlight overlay editor ── */
.editor-highlight-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.editor-highlight-layer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; font-family: var(--sans); font-size: 15px; line-height: 1.85; color: transparent; padding: 0; margin: 0; border: none; z-index: 0; }
.editor-highlight-layer mark { background: rgba(255, 213, 79, 0.35); color: transparent; border-radius: 2px; cursor: pointer; pointer-events: auto; position: relative; }
.editor-highlight-layer mark:hover { background: rgba(255, 213, 79, 0.6); }
.editor-highlight-layer mark.active { background: rgba(255, 183, 0, 0.5); }
#journalEditor { position: relative; width: 100%; height: 100%; min-height: 0; overflow-y: auto; background: transparent; border: none; border-radius: 0; padding: 0; font-family: var(--sans); font-size: 15px; line-height: 1.85; color: var(--ink); resize: none; outline: none; display: block; z-index: 1; box-sizing: border-box; }
#journalEditor::placeholder { color: #b8af9e; }
/* ── Linked entries badge ── */
.linked-entries-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.linked-entry-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-family: var(--sans); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; color: var(--muted); transition: all 0.15s; text-decoration: none; }
.linked-entry-chip:hover { border-color: var(--accent); color: var(--accent); }
.linked-entry-chip .bi { font-size: 10px; }
.link-add-btn { background: none; border: 1px dashed var(--border); border-radius: 999px; padding: 3px 10px; font-size: 11px; color: var(--muted); cursor: pointer; font-family: var(--sans); transition: all 0.15s; }
.link-add-btn:hover { border-color: var(--accent); color: var(--accent); }
/* ── Note highlight active in sidebar ── */
.jnote-card.highlight-active { border-color: var(--gold); background: rgba(255, 213, 79, 0.08); }
.word-counter { font-size: 11px; color: var(--muted); margin-top: 10px; text-align: right; opacity: 0.6; flex-shrink: 0; }
.mood-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; flex-shrink: 0; }
.mood-label { font-size: 12px; color: var(--muted); }
.mood-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-chip { padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 500; background: var(--surface); border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: all 0.15s; font-family: var(--sans); }
.mood-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Analysis panel ── */
.analysis-panel { border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; background: var(--card); }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-head h3 { font-size: 15px; margin-bottom: 12px; font-weight: 600; letter-spacing: -0.01em; font-family: var(--sans); }
.active-entry-info { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 9px 12px; margin-bottom: 9px; }
.active-entry-info:empty { display: none; }
.aei-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 0; }
.aei-date { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.aei-subject { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.aei-words { font-size: 11px; color: var(--muted); }
.analyze-btn { width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 0; padding: 10px; font-size: 12px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: opacity 0.2s; }
.analyze-btn:hover { opacity: 0.85; }
.analyze-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.panel-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-tab { flex: 1; padding: 10px 4px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; transition: all 0.15s; }
.panel-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; }
.tab-section { display: none; }
.tab-section.active { display: block; }
.empty-panel { text-align: center; padding: 28px 10px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.empty-panel .ei { font-size: 24px; margin-bottom: 8px; }
.cached-banner { background: var(--accent-light); border: 1px solid rgba(61,90,128,.2); border-radius: 0; padding: 8px 12px; margin-bottom: 12px; font-size: 11px; color: var(--accent); line-height: 1.5; }
.analysis-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 11px 13px; margin-bottom: 9px; animation: fadeUp 0.3s ease; }
.badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px; }
.badge-warning { background: var(--amber-light); color: var(--amber); }
.badge-insight { background: var(--accent-light); color: var(--accent); }
.badge-positive { background: var(--green-light); color: var(--green); }
.badge-pattern { background: var(--purple-light); color: var(--purple); }
.card-quote { font-size: 12px; color: var(--muted); font-style: italic; padding-left: 9px; border-left: 2px solid var(--border); margin-bottom: 7px; line-height: 1.5; }
.card-text { font-size: 12px; line-height: 1.6; color: var(--ink); }
.card-freq { font-size: 10px; color: var(--purple); margin-top: 5px; }
.score-item { margin-bottom: 13px; }
.score-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.score-bar { height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 3px; transition: width 1s ease; width: 0%; }
.fill-red{background:var(--red)}.fill-amber{background:var(--amber)}.fill-green{background:var(--green)}.fill-blue{background:var(--accent)}.fill-purple{background:var(--purple)}.fill-teal{background:#2a9d8f}.fill-coral{background:#e07a5f}.fill-indigo{background:#5a67d8}.fill-mint{background:#38b2ac}.fill-gold{background:#d69e2e}.fill-rose{background:#d53f8c}
.trend-note { font-size: 10px; color: var(--muted); margin-top: 2px; font-style: italic; }
.summary-box { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 11px; margin-top: 12px; font-size: 12px; line-height: 1.7; }
.summary-box strong { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.prompt-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 11px 13px; margin-bottom: 7px; cursor: pointer; transition: all 0.15s; animation: fadeUp 0.3s ease; }
.prompt-card:hover { border-color: var(--purple); background: var(--purple-light); }
.prompt-num { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--purple); margin-bottom: 4px; font-weight: 500; }
.prompt-q { font-family: var(--serif); font-size: 13px; line-height: 1.5; font-style: italic; color: var(--ink); }
.prompt-why { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.use-hint { font-size: 10px; color: var(--purple); margin-top: 5px; text-align: right; }
.notes-grid { display: flex; flex-direction: column; gap: 9px; margin-top: 9px; }
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 11px; }
.note-card h4 { font-size: 12px; margin-bottom: 4px; }
.note-card p { font-size: 11px; color: var(--muted); line-height: 1.6; }
/* ── Journal entry notes tab ── */
.jnotes-section { }
.jnotes-hd { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.jnotes-hd-title { font-size:12px; font-weight:600; font-family:var(--sans); letter-spacing:-0.01em; color:var(--ink); }
.jnotes-hint { font-size:11px; color:var(--muted); margin-bottom:10px; line-height:1.5; }
.jnote-quote-preview { background:var(--surface); border-left:3px solid var(--accent); border-radius:0 var(--radius-sm) var(--radius-sm) 0; padding:7px 10px; font-size:11px; color:var(--muted); font-style:italic; margin-bottom:7px; line-height:1.5; }
.jnote-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 11px; margin-bottom:8px; }
.jnote-card.ai-note { border-left:3px solid var(--accent); }
.jnote-card.ai-note .jnote-text::before { content:'✨ '; opacity:.6; font-size:11px; }

/* ── AI-annotation marks in the journal editor highlight overlay ── */
/* User-authored notes get the standard yellow <mark>. AI annotations
   get a soft dotted underline + a small comment icon at the end of
   the phrase. No clinical label is shown — click reveals the warm note. */
.editor-highlight-layer mark.ai-mark {
  background: transparent;
  border-bottom: 1.5px dotted var(--accent);
  padding-bottom: 1px;
  cursor: pointer;
  position: relative;
}
.editor-highlight-layer mark.ai-mark:hover { background: rgba(107,77,46,0.06); }
.editor-highlight-layer mark.ai-mark.active { background: rgba(107,77,46,0.12); }
.editor-highlight-layer mark.ai-mark::after {
  content: '\F4A8'; /* bi-chat-left-text-fill */
  font-family: 'bootstrap-icons';
  font-size: 9px;
  color: var(--accent);
  margin-left: 3px;
  vertical-align: super;
  opacity: 0.75;
}
.editor-highlight-layer mark.ai-mark[data-sev="3"] { border-bottom-color: var(--accent); border-bottom-style: solid; border-bottom-width: 1.5px; }
.editor-highlight-layer mark.ai-mark[data-sev="1"]::after { opacity: 0.5; }
.jnote-quote { font-size:11px; color:var(--muted); font-style:italic; margin-bottom:5px; padding-bottom:5px; border-bottom:1px solid var(--border); line-height:1.5; }
.jnote-text { font-size:12px; line-height:1.6; color:var(--ink); }
.jnote-badge { font-size:10px; font-weight:600; color:var(--accent); text-transform:uppercase; letter-spacing:0.04em; margin-bottom:2px; }
.jnote-footer { display:flex; align-items:center; justify-content:space-between; margin-top:7px; }
.jnote-time { font-size:10px; color:var(--muted); }
.jnote-del { background:none; border:none; cursor:pointer; color:var(--muted); font-size:11px; padding:2px 4px; border-radius:4px; }
.jnote-del:hover { color:var(--red); background:var(--red-light); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.section-header h4 { font-size: 12px; margin: 0; }

/* ── Google Docs tab (inside dashboard journal) ── */
/* flex:1 + min-height:0 so the panel fills all remaining height below
   the tab bar instead of the old fixed calc(100vh - 220px) which left
   visible dead space at the bottom of the page. */
#cGdocsPanel { display:none; gap:0; flex:1; min-height:0; border:1px solid var(--border); border-top:none; border-radius:0 0 var(--radius-lg) var(--radius-lg); overflow:hidden; }

/* ── Full Entry Log ── */
.el-panel { display:flex; flex-direction:column; flex:1; min-height:0; border:1px solid var(--border); border-top:none; border-radius:0 0 var(--radius-lg) var(--radius-lg); overflow:hidden; background:var(--bg); }
.el-topbar { display:flex; align-items:center; gap:12px; padding:14px 20px; border-bottom:1px solid var(--border); background:var(--card); flex-shrink:0; flex-wrap:wrap; }
.el-search-wrap { display:flex; align-items:center; gap:8px; flex:1; min-width:180px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:8px 12px; }
.el-search-wrap input { border:none; background:transparent; font-size:13px; outline:none; flex:1; color:var(--ink); }
.el-controls { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.el-controls select { font-size:12px; padding:7px 10px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--ink); cursor:pointer; }
.el-view-toggle { display:flex; gap:2px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:2px; }
.el-vbtn { width:30px; height:30px; border:none; background:transparent; border-radius:6px; cursor:pointer; color:var(--muted); display:flex; align-items:center; justify-content:center; font-size:14px; transition:all .15s; }
.el-vbtn.active { background:var(--card); color:var(--ink); box-shadow:0 1px 3px var(--shadow); }
.el-tabs { display:flex; gap:0; border-bottom:1px solid var(--border); background:var(--card); flex-shrink:0; padding:0 20px; }
.el-tab { background:none; border:none; border-bottom:2px solid transparent; padding:11px 16px; font-size:13px; font-family:var(--sans); font-weight:500; color:var(--muted); cursor:pointer; transition:all .15s; display:flex; align-items:center; gap:6px; margin-bottom:-1px; }
.el-tab.active { color:var(--ink); border-bottom-color:var(--accent); }
.el-content { flex:1; overflow-y:auto; padding:20px; min-height:0; }
.el-group-header { font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); margin:20px 0 10px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.el-group-header:first-child { margin-top:0; }
.el-list-item { display:flex; align-items:flex-start; gap:14px; padding:14px 16px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:6px; cursor:pointer; transition:all .15s; }
.el-list-item:hover { border-color:var(--accent); box-shadow:0 2px 8px var(--shadow); }
.el-list-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); flex-shrink:0; margin-top:5px; }
.el-list-main { flex:1; min-width:0; }
.el-list-subject { font-size:14px; font-weight:500; color:var(--ink); margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.el-list-excerpt { font-size:12px; color:var(--muted); line-height:1.5; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.el-list-meta { display:flex; align-items:center; gap:8px; margin-top:6px; flex-wrap:wrap; }
.el-list-date { font-size:11px; color:var(--muted); }
.el-list-words { font-size:11px; color:var(--muted); }
.el-list-label { font-size:10px; padding:2px 8px; border-radius:999px; background:var(--accent-light); color:var(--accent); border:1px solid rgba(61,90,128,.15); cursor:pointer; }
.el-list-label:hover { background:var(--accent); color:#fff; }
.el-list-actions { display:flex; gap:6px; flex-shrink:0; opacity:0; transition:opacity .15s; }
.el-list-item:hover .el-list-actions { opacity:1; }
.el-list-btn { background:none; border:1px solid var(--border); border-radius:var(--radius-sm); padding:5px 9px; font-size:11px; color:var(--muted); cursor:pointer; font-family:var(--sans); transition:all .15s; }
.el-list-btn:hover { color:var(--ink); border-color:var(--ink); }
.el-list-btn.danger:hover { color:var(--red,#c0392b); border-color:var(--red,#c0392b); }
.el-has-analysis { width:16px; height:16px; border-radius:50%; background:var(--purple-light,#ede7f6); color:var(--purple,#7c3aed); display:flex; align-items:center; justify-content:center; font-size:9px; flex-shrink:0; margin-top:2px; }
.el-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:12px; }
.el-grid-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:16px; cursor:pointer; transition:all .15s; display:flex; flex-direction:column; gap:8px; }
.el-grid-card:hover { border-color:var(--accent); box-shadow:0 4px 16px var(--shadow); transform:translateY(-1px); }
.el-grid-date { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.el-grid-subject { font-size:14px; font-weight:500; color:var(--ink); line-height:1.3; }
.el-grid-excerpt { font-size:12px; color:var(--muted); line-height:1.5; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; flex:1; }
.el-grid-footer { display:flex; align-items:center; justify-content:space-between; margin-top:4px; }
.el-grid-words { font-size:11px; color:var(--muted); }
.el-label-chip { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; font-size:10px; font-weight:500; background:var(--accent-light); color:var(--accent); border:1px solid rgba(61,90,128,.15); margin-right:4px; cursor:pointer; transition:background 0.15s; }
.el-label-chip:hover { background:rgba(61,90,128,.15); }
.el-add-label { background:none; border:1px dashed var(--border); border-radius:999px; padding:2px 8px; font-size:10px; color:var(--muted); cursor:pointer; font-family:var(--sans); }
.el-add-label:hover { border-color:var(--accent); color:var(--accent); }
.el-summary-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; margin-bottom:10px; }
.el-summary-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }
.el-summary-date { font-size:11px; color:var(--muted); }
.el-summary-subject { font-size:15px; font-weight:500; color:var(--ink); }
.el-summary-text { font-size:13px; color:var(--ink); line-height:1.7; }
.el-summary-badges { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.el-no-analysis { display:flex; flex-direction:column; align-items:center; gap:8px; padding:32px; text-align:center; color:var(--muted); }
.el-empty { display:flex; flex-direction:column; align-items:center; gap:12px; padding:60px 20px; text-align:center; color:var(--muted); }
.el-empty i { font-size:36px; opacity:.3; }
.el-empty p { font-size:14px; }

/* ── AI Summary Settings Panel ── */
.el-settings-toggle { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); cursor:pointer; margin-bottom:12px; transition:all .15s; user-select:none; }
.el-settings-toggle:hover { border-color:var(--accent); }
.el-settings-toggle span { font-size:13px; font-weight:500; color:var(--ink); display:flex; align-items:center; gap:6px; }
.el-settings-toggle .bi-chevron-down { font-size:12px; color:var(--muted); transition:transform .25s; }
.el-settings-toggle.open .bi-chevron-down { transform:rotate(180deg); }
.el-settings-panel { max-height:0; overflow:hidden; transition:max-height .35s ease, overflow 0s .35s; }
.el-settings-panel.open { max-height:340px; overflow-y:auto; transition:max-height .35s ease, overflow 0s 0s; }
.el-settings-inner { padding:0 0 12px; display:flex; flex-direction:column; gap:8px; }
.el-settings-section { background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px; }
.el-settings-section-title { font-size:10px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); margin-bottom:10px; }
.el-settings-row { display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:8px; }
.el-settings-row:last-child { margin-bottom:0; }
.el-settings-group { display:flex; flex-direction:column; gap:4px; flex:1; min-width:120px; }
.el-settings-group label { font-size:11px; font-weight:500; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.el-settings-group input[type="text"],
.el-settings-group input[type="number"],
.el-settings-group input[type="date"],
.el-settings-group select { font-size:12px; padding:7px 10px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--ink); font-family:var(--sans); outline:none; transition:border-color .15s; }
.el-settings-group input:focus,
.el-settings-group select:focus { border-color:var(--accent); }
.el-settings-chips { display:flex; gap:5px; flex-wrap:wrap; }
.el-settings-chip { font-size:11px; padding:4px 11px; border-radius:999px; border:1px solid var(--border); background:transparent; cursor:pointer; font-family:var(--sans); color:var(--muted); transition:all .15s; user-select:none; }
.el-settings-chip:hover { border-color:var(--accent); color:var(--accent); }
.el-settings-chip.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.el-settings-slider { width:100%; height:4px; -webkit-appearance:none; appearance:none; background:var(--border); border-radius:2px; outline:none; margin-top:4px; }
.el-settings-slider::-webkit-slider-thumb { -webkit-appearance:none; width:16px; height:16px; border-radius:50%; background:var(--accent); cursor:pointer; border:2px solid var(--card); box-shadow:0 1px 3px var(--shadow); }
.el-settings-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding-top:4px; }
.el-settings-btn { display:inline-flex; align-items:center; gap:5px; font-size:12px; padding:7px 14px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--card); color:var(--ink); cursor:pointer; font-family:var(--sans); font-weight:500; transition:all .15s; }
.el-settings-btn:hover { border-color:var(--accent); color:var(--accent); }
.el-settings-btn.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.el-settings-btn.primary:hover { background:var(--ink); border-color:var(--ink); }
.el-settings-btn.primary:disabled { opacity:.5; cursor:not-allowed; }
.el-settings-btn.danger:hover { color:var(--red,#c0392b); border-color:var(--red,#c0392b); }
.el-batch-progress { margin-top:10px; }
.el-batch-bar { height:5px; background:var(--surface); border-radius:3px; overflow:hidden; }
.el-batch-fill { height:100%; background:var(--accent); border-radius:3px; transition:width .3s ease; width:0; }
.el-batch-status { font-size:11px; color:var(--muted); margin-top:4px; }
.el-depth-toggle { display:flex; gap:2px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:2px; }
.el-depth-btn { padding:5px 12px; border:none; background:transparent; border-radius:6px; cursor:pointer; color:var(--muted); font-size:11px; font-family:var(--sans); font-weight:500; transition:all .15s; }
.el-depth-btn.active { background:var(--card); color:var(--ink); box-shadow:0 1px 3px var(--shadow); }
.el-compare-row { display:flex; gap:12px; margin-top:8px; padding:10px 14px; background:var(--surface); border-radius:var(--radius-sm); border:1px solid var(--border); }
.el-compare-cols { display:flex; gap:16px; }
.el-compare-col { flex:1; min-width:0; }
.el-compare-col-header { font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); margin-bottom:10px; padding-bottom:6px; border-bottom:2px solid var(--accent); }
.el-section-toggles { display:flex; gap:5px; flex-wrap:wrap; }
.el-section-toggle { font-size:11px; padding:4px 11px; border-radius:999px; border:1px solid var(--border); background:transparent; cursor:pointer; font-family:var(--sans); color:var(--muted); transition:all .15s; display:flex; align-items:center; gap:4px; }
.el-section-toggle.active { background:var(--accent-light); color:var(--accent); border-color:rgba(61,90,128,.2); }
.el-section-toggle .bi-check2 { font-size:10px; }
.el-filtered-count { font-size:11px; color:var(--muted); margin-left:auto; white-space:nowrap; }
/* Score bars in summary cards */
.el-score-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.el-score-label { font-size:11px; color:var(--muted); width:140px; flex-shrink:0; }
.el-score-bar-bg { flex:1; height:5px; background:var(--surface); border-radius:3px; overflow:hidden; }
.el-score-bar-fill { height:100%; border-radius:3px; background:var(--accent); }
.el-score-val { font-size:11px; color:var(--ink); width:32px; text-align:right; flex-shrink:0; }
.el-score-trend { font-size:10px; margin-left:2px; }
.el-score-trend.improving { color:var(--green); }
.el-score-trend.worsening { color:var(--red); }
.el-score-trend.stable { color:var(--muted); }
/* Emotion breakdown bars */
.el-emotion-row { display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.el-emotion-label { font-size:11px; color:var(--muted); width:70px; flex-shrink:0; text-transform:capitalize; }
.el-emotion-bar-bg { flex:1; height:4px; background:var(--surface); border-radius:2px; overflow:hidden; }
.el-emotion-bar-fill { height:100%; border-radius:2px; }
.el-emotion-bar-fill.joy { background:var(--gold); }
.el-emotion-bar-fill.sadness { background:var(--accent); }
.el-emotion-bar-fill.anxiety { background:var(--amber); }
.el-emotion-bar-fill.anger { background:var(--red); }
.el-emotion-bar-fill.shame { background:var(--purple); }
.el-emotion-bar-fill.hope { background:var(--green); }
/* Prompt cards in summary */
.el-prompt-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px; margin-bottom:6px; }
.el-prompt-q { font-size:13px; font-weight:500; color:var(--ink); margin-bottom:3px; }
.el-prompt-why { font-size:11px; color:var(--muted); line-height:1.5; }
/* Summary section headers inside cards */
.el-summary-section-head { font-size:10px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:14px 0 8px; }
.el-summary-section-head:first-child { margin-top:6px; }

#cGdocsPanel.gdocs-active { display:flex; }
.cGdocs-list-card { width:240px; flex-shrink:0; display:flex; flex-direction:column; min-height:0; padding:14px; border-right:1px solid var(--border); background:var(--card); }
.cGdocs-embed-card { flex:1; display:flex; flex-direction:column; min-height:0; overflow:hidden; background:var(--card); }
.cGdocs-embed-card iframe { flex:1; width:100%; border:none; min-height:0; display:block; }
/* Stack the doc list above the embed on narrow viewports so neither
   gets squashed into uselessness. The list stays compact (180px tall)
   and the embed takes the remaining height. */
@media (max-width: 760px) {
  #cGdocsPanel { flex-direction: column; }
  .cGdocs-list-card { width: 100%; max-height: 180px; border-right: none; border-bottom: 1px solid var(--border); }
  .cGdocs-embed-card { flex: 1; min-height: 240px; }
}
.cgdoc-item { padding:9px 11px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--surface); cursor:pointer; transition:all 0.15s; flex-shrink:0; }
.cgdoc-item:hover, .cgdoc-item.gdoc-active { border-color:var(--accent); background:var(--accent-light); }
.cgdoc-item .gdi-name { font-size:12px; font-weight:500; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cgdoc-item .gdi-date { font-size:10px; color:var(--muted); }
.cgdocs-center-state { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; gap:14px; text-align:center; padding:28px; }
.cgdocs-search { width:100%; padding:7px 9px; border-radius:var(--radius-sm); border:1px solid var(--border); font-size:12px; font-family:var(--sans); background:var(--surface); color:var(--ink); margin-bottom:7px; flex-shrink:0; box-sizing:border-box; }
.cgdocs-search:focus { outline:none; border-color:var(--accent); }

/* ── Collapsible "Drive Docs" column ── */
.cGdocs-rail { display:none; }
#cGdocsPanel.gdocs-collapsed .cGdocs-list-card { display:none; }
#cGdocsPanel.gdocs-collapsed .cGdocs-rail {
  display:flex; width:36px; flex-shrink:0; align-items:flex-start; justify-content:center;
  padding-top:14px; border-right:1px solid var(--border); background:var(--card);
}
.cGdocs-rail button {
  background:none; border:1px solid var(--border); border-radius:var(--radius-sm); cursor:pointer;
  color:var(--muted); width:26px; height:26px; display:inline-flex; align-items:center;
  justify-content:center; font-size:13px; transition:all .12s;
}
.cGdocs-rail button:hover { color:var(--ink); border-color:var(--ink); }
/* Draggable splitter between the file list and the workspace */
.cGdocs-splitter { width:6px; flex-shrink:0; cursor:col-resize; background:transparent; transition:background .12s; }
.cGdocs-splitter:hover { background:var(--border); }
#cGdocsPanel.gdocs-collapsed .cGdocs-splitter { display:none; }
/* Roomier file-toolbar buttons (override the tight inline padding) */
#cgdocsToolbar > .btn { padding:7px 13px !important; font-size:12.5px !important; }
.cgdoc-item { padding:11px 13px; }

/* ── Journal Log (compact, scroll-to read) ── */
.jlog-section { padding:28px 0 48px; }
.jlog-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; padding:0 20px; }
.jlog-header h3 { font-family:var(--sans); font-weight:600; font-size:16px; letter-spacing:0; margin:0; color:var(--ink); }
.jlog-header span { font-size:12px; color:var(--muted); letter-spacing:0; }
.jlog-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.jlog-entry { display:flex; align-items:center; gap:16px; padding:14px 20px; border-bottom:1px solid var(--border); cursor:pointer; transition:background 0.15s; min-width:0; }
.jlog-entry:last-child { border-bottom:none; }
.jlog-entry:hover { background:var(--surface); }
.jlog-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); flex-shrink:0; }
.jlog-meta { flex-shrink:0; width:104px; }
.jlog-date { font-size:12px; color:var(--muted); font-weight:400; white-space:nowrap; letter-spacing:0; }
.jlog-body { flex:1; min-width:0; display:flex; align-items:baseline; gap:12px; overflow:hidden; }
.jlog-subject { font-size:14px; font-weight:600; letter-spacing:0; color:var(--ink); white-space:nowrap; flex-shrink:0; max-width:240px; overflow:hidden; text-overflow:ellipsis; }
.jlog-excerpt { font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; min-width:0; letter-spacing:0; }
.jlog-words { font-size:12px; color:var(--muted); flex-shrink:0; }
.jlog-delete { flex-shrink:0; background:none; border:none; cursor:pointer; color:var(--muted); font-size:13px; padding:2px 4px; border-radius:4px; opacity:0.55; transition:opacity 0.15s, color 0.15s; line-height:1; }
.jlog-entry:hover .jlog-delete { opacity:1; }
.jlog-delete:hover { color:var(--red,#c0392b); }
@media (hover:none) { .jlog-delete { opacity:1; } }
.jlog-empty { padding:28px 20px; text-align:center; color:var(--muted); font-size:13px; }

/* ── In-app rich-text editor (Google Docs editing) ── */
.ss-rte-toolbar { display:flex; align-items:center; gap:5px; flex-wrap:wrap; padding:7px 12px; background:var(--surface); border-bottom:1px solid var(--border); flex-shrink:0; }
.ss-rte-toolbar select { width:auto; max-width:170px; flex:0 0 auto; font-size:12px; padding:4px 24px 4px 8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--card); color:var(--ink); font-family:var(--sans); cursor:pointer; }
/* Icon format buttons only — exclude the .btn Cancel/Save buttons so they
   keep their normal width and don't collapse into squished squares. */
.ss-rte-toolbar > button:not(.btn) { width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--card); color:var(--ink); cursor:pointer; font-size:13px; line-height:1; padding:0; transition:background .12s, border-color .12s; }
.ss-rte-toolbar > button:not(.btn):hover { background:var(--surface); border-color:var(--ink); }
.ss-rte-color { width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--card); color:var(--ink); cursor:pointer; position:relative; font-size:13px; }
.ss-rte-color input { position:absolute; inset:0; opacity:0; cursor:pointer; }
/* Gray canvas that holds the page (Google Docs print-layout feel) */
.ss-rte-canvas { flex:1; min-height:0; overflow-y:auto; background:#e9e9e7; padding:28px 16px; }
/* The editable "page": white 8.5in sheet, ~0.9in margins, drop shadow */
.ss-rte-surface { max-width:816px; margin:0 auto; background:#fff; box-shadow:0 1px 6px rgba(0,0,0,0.18); border-radius:2px; padding:76px 84px; min-height:1056px; color:var(--ink); font-family:var(--sans); font-size:14px; line-height:1.7; outline:none; }
.ss-rte-surface h1 { font-size:22px; margin:0 0 10px; }
.ss-rte-surface h2 { font-size:18px; margin:16px 0 8px; }
.ss-rte-surface h3 { font-size:15px; margin:14px 0 6px; }
.ss-rte-surface p { margin:0 0 10px; }
.ss-rte-surface ul, .ss-rte-surface ol { margin:0 0 10px; padding-left:24px; }
.ss-rte-surface a { color:#1a73e8; }
/* Editable spreadsheet grid */
.ss-grid-scroll { flex:1; min-height:0; overflow:auto; background:var(--card); }
.ss-grid { border-collapse:collapse; width:max-content; min-width:100%; }
.ss-grid-cell { border:1px solid var(--border); padding:6px 10px; font-size:13px; color:var(--ink); min-width:96px; max-width:320px; outline:none; white-space:pre-wrap; }
.ss-grid-cell:focus { background:var(--surface); box-shadow:inset 0 0 0 2px var(--accent); }
.ss-grid tr:first-child .ss-grid-cell { font-weight:600; background:var(--surface); }

/* ── Responsive (matches therapist breakpoints at 1300/1100) ── */
@media (max-width: 1300px) { .journal-app { grid-template-columns: 220px 1fr 300px; } }
@media (max-width: 1100px) { .journal-app { grid-template-columns: 200px 1fr; } .analysis-panel { display: none; } }
@media (max-width: 768px)  { .journal-app { grid-template-columns: 1fr; } .journal-sidebar { display: none; } }

/* ── Connect / Browse section ── */
.dir-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dir-filter-chip {
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: all 0.15s; font-family: var(--sans);
}
.dir-filter-chip.active, .dir-filter-chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.dir-filter-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dir-filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 120px; flex: 1; }
.dir-filter-group label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.dir-therapist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 14px; }
.dir-therapist-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 0;
  padding: 18px; transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.dir-therapist-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.07); border-color: var(--accent); }
.dir-therapist-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dir-therapist-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 15px; flex-shrink: 0; overflow: hidden;
}
.dir-therapist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dir-therapist-degree { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dir-therapist-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }

/* ── Settings panel ── */
.st-shell { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.st-nav { display: flex; flex-direction: column; gap: 2px; }
.st-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border-radius: 0;
  font-size: 13px; color: var(--muted); cursor: pointer;
  border: none; background: transparent; text-align: left;
  font-family: var(--sans); transition: all 0.15s;
}
.st-nav-item:hover { background: var(--surface); color: var(--ink); }
.st-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.st-ni-icon { font-size: 15px; width: 18px; text-align: center; }
.st-panel { display: none; }
.st-panel.active { display: flex; flex-direction: column; gap: 20px; }
.settings-card { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 24px; box-shadow: 0 2px 16px var(--shadow); }
.settings-card h3 { margin-bottom: 6px; font-family: var(--sans); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.settings-card .sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.avatar-row { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.avatar-large { width: 68px; height: 68px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 22px; font-family: var(--serif); overflow: hidden; flex-shrink: 0; border: 2px solid var(--border); }
.avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.credential-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; gap: 12px; }
.credential-row .cred-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.credential-row .cred-value { font-size: 14px; font-family: monospace; color: var(--ink); }
.verify-gate { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 28px; text-align: center; }
.verify-gate .lock-icon { font-size: 32px; margin-bottom: 12px; }
.verify-gate h4 { margin-bottom: 6px; font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.verify-gate p { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.verify-form { max-width: 300px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.username-wrap { position: relative; display: flex; align-items: center; }
.username-wrap .at-prefix { position: absolute; left: 13px; color: var(--muted); font-size: 14px; pointer-events: none; user-select: none; }
.username-wrap input { padding-left: 26px; }
.username-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
@media (max-width: 760px) { .st-shell { grid-template-columns: 1fr; } }

/* ── Clinicians master-detail layout ── */
/* ── Drill-view shell (clinicians) — mirrors the therapist client-management
   flow: list of cards → click → full-pane detail with back button. ── */
#section-clinicians.drv-active.active {
  flex: 1 !important;
  min-height: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden;
}
.hub-main:has(#section-clinicians.drv-active.active)::after { display: none; }

.drv-shell {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.drv-header {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.drv-header-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 500; }
.drv-header-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); font-family: var(--sans); }
.drv-header-titlewrap { min-width: 0; flex-shrink: 1; display: flex; flex-direction: column; }
.drv-header-spacer { flex: 1; }
.drv-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.drv-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 0;
  font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; font-family: var(--sans);
  flex-shrink: 0;
}
.drv-back-btn:hover { color: var(--ink); background: var(--surface); border-color: var(--accent); }
.drv-back-btn i { font-size: 13px; }
.drv-toolbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.drv-toolbar input[type="text"] {
  font-size: 12.5px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 0;
  background: var(--surface); color: var(--ink);
  font-family: var(--sans);
  max-width: 320px; flex: 1;
}
.drv-toolbar input[type="text"]:focus { border-color: var(--accent); outline: none; }
.drv-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  background: var(--bg);
  position: relative;
}
.drv-shell[data-view="list"]   .drv-detail-view,
.drv-shell[data-view="detail"] .drv-list-view,
.drv-shell[data-view="detail"] .drv-toolbar { display: none; }
.drv-shell[data-view="detail"] .drv-back-btn { display: inline-flex; }
.drv-shell[data-view="list"]   .drv-back-btn { display: none; }

.drv-list-view { padding: 24px 32px 56px; }
.drv-cards { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.drv-card {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.12s;
}
.drv-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,24,20,.06); }
.drv-card.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.drv-card-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 15px; flex-shrink: 0;
  overflow: hidden;
}
.drv-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.drv-card-body { flex: 1; min-width: 0; }
.drv-card-title { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 4px; font-family: var(--sans); }
.drv-card-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.drv-card-arrow { font-size: 14px; color: var(--muted); opacity: 0.5; flex-shrink: 0; transition: transform 0.15s, opacity 0.15s; }
.drv-card:hover .drv-card-arrow { opacity: 1; transform: translateX(2px); color: var(--accent); }

.drv-empty {
  max-width: 480px; margin: 40px auto;
  padding: 48px 32px; text-align: center;
  background: var(--card); border: 1px dashed var(--border);
  border-radius: 0;
}
.drv-empty i { font-size: 36px; opacity: 0.35; display: block; margin-bottom: 12px; }
.drv-empty p { font-size: 14px; color: var(--muted); line-height: 1.6; }

.drv-detail-view { padding: 0; }
.drv-detail-wrap { width: 100%; max-width: none; }
/* Fill-height treatment for clinician detail view — same as therapist client detail. */
#cliniciansShellV2[data-view="detail"] .drv-body { overflow: hidden; }
#cliniciansShellV2[data-view="detail"] .drv-detail-view {
  height: 100%; box-sizing: border-box; display: flex; flex-direction: column;
}
#cliniciansShellV2[data-view="detail"] .drv-detail-wrap {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}

.clin-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; align-items: stretch; border: 1px solid var(--border); border-radius: 0; overflow: hidden; box-shadow: 0 2px 16px var(--shadow); flex: 1; min-height: 0; }
.clin-left { background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.clin-left-header { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.clin-left-list { overflow-y: auto; flex: 1; }
.clin-menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid rgba(216,208,192,0.4); transition: background .12s; border-left: 3px solid transparent; }
.clin-menu-item:hover { background: var(--surface); }
.clin-menu-item.active { background: var(--accent-light); border-left-color: var(--accent); }
.clin-menu-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 13px; flex-shrink: 0; overflow: hidden; }
.clin-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.clin-menu-name { font-size: 13px; font-weight: 500; margin-bottom: 1px; }
.clin-menu-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px; }
.clin-right { background: var(--bg); display: flex; flex-direction: column; }
.clin-empty { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 400px; flex-direction: column; gap: 10px; }
.clin-header { padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--card); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.clin-tabs { display: flex; gap: 0; background: var(--card); border-bottom: 1px solid var(--border); padding: 0 24px; flex-wrap: wrap; }
.clin-tab { padding: 10px 14px; font-size: 13px; border: none; background: transparent; cursor: pointer; color: var(--muted); font-family: var(--sans); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; white-space: nowrap; }
.clin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.clin-body { padding: 24px; overflow-y: auto; flex: 1; }
/* Chat bubbles */
.chat-bw { display: flex; flex-direction: column; gap: 3px; position: relative; }
.chat-bw.mine { align-items: flex-end; }
.chat-bw.theirs { align-items: flex-start; }
.chat-bubble-row { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.chat-bw.mine .chat-bubble-row { flex-direction: row-reverse; }
.chat-bubble { max-width: 66%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.chat-bubble.mine { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { background: var(--surface); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-bubble.retracted { font-style: italic; opacity: 0.72; }
.chat-ts { font-size: 10px; color: var(--muted); }
.chat-msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.chat-bubble-row:hover .chat-msg-actions { opacity: 1; }
.chat-msg-actions button { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 12px; line-height: 1; }
.chat-msg-actions button:hover { background: var(--surface); color: var(--ink); }
.chat-disclaimer { font-size: 10.5px; color: var(--muted); padding: 6px 16px 10px; line-height: 1.35; background: var(--card); border-top: 1px dashed var(--border); text-align: center; }
@media (max-width: 900px) { .clin-layout { grid-template-columns: 1fr; } .clin-left { min-height: auto; max-height: 260px; } }

/* ── Embed mode (when opened inside session-client.html iframe) ── */
body.embed .topbar { display: none !important; }
body.embed .hub-sidebar { display: none !important; }
body.embed .hub-shell { grid-template-columns: 1fr !important; }
body.embed .hub-main { padding: 12px 14px !important; }
body.embed .hub-main::after { display: none !important; }
body.embed .section-hero { padding: 10px 0 12px !important; margin-bottom: 8px !important; }
body.embed .section-hero h1 { font-size: 18px !important; letter-spacing: 0.01em !important; }
body.embed .section-hero p { font-size: 12px !important; }
body.embed .da-hero,
body.embed .session-hero { display: none !important; }
body.embed .sidebar-signout { display: none !important; }
