/* ── 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 fills the visible screen when scrolled to the top; the
   Recent Entries log then sits spaciously below, reached by scrolling
   down (mirrors the Boards module treatment). height:100% fills the
   scroll viewport exactly so there's no cream "peek" under the editor. */
#section-journal .journal-app,
#section-journal .el-panel {
  flex: 0 0 auto !important;
  height: 100% !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: 1fr var(--jp-aw, 380px);
  /* The rail folds and unfolds rather than snapping; the writing column
     widens with it. Suppressed mid-drag (.jp-dragging) so the resize handle
     tracks the pointer exactly instead of easing behind it. */
  transition: grid-template-columns 0.34s cubic-bezier(.4, 0, .2, 1);
  /* Fill the container height so the 3 panels stretch full-height instead of
     sizing to content (matches clinician .tj-journal-app which has this). */
  grid-template-rows: minmax(0, 1fr);
  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 54px 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; }
/* The topic sits between the name and the word count — smaller than the
   name, and in the prompt's lavender so it reads as the category tag it is
   rather than a second title. */
.entry-item-topic { font-size: 11.5px; color: var(--purple); opacity: .8; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-item-meta { font-size: 11px; color: var(--muted); }
.entry-item-actions { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); display: flex; align-items: center; gap: 2px; 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, .entry-item.pinned .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-pin-btn { background: none; border: none; cursor: pointer; width: 22px; height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); padding: 0; line-height: 1; }
.entry-pin-btn:hover { background: var(--surface); color: var(--ink); }
.entry-item.pinned .entry-pin-btn { color: var(--accent); }
#section-journal .entry-group-label { font-size: 11px; letter-spacing: 0.01em; text-transform: none; color: var(--muted); font-weight: 600; margin: 16px 2px 8px; }
#section-journal #entryList > .entry-group-label:first-child { margin-top: 4px; }
#section-journal .entry-pinned-label { color: var(--accent); display: flex; align-items: center; gap: 5px; }
/* Plain sans label, not a spaced-caps eyebrow — override the global bare-label rule (which uses !important). */
#section-journal .entries-hide-empty { display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: normal !important; text-transform: none !important; color: var(--muted); cursor: pointer; margin: 2px 2px 10px; user-select: none; }
#section-journal .entries-hide-empty input { accent-color: var(--ink); cursor: pointer; margin: 0; }
.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) ── */
.as-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; }
.as-entry-menu.open { display: block; }
.as-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); }
.as-entry-menu .entry-menu-item:hover { background: var(--surface); }
.as-entry-menu .entry-menu-item.danger { color: #c0392b; }
.as-entry-menu .entry-menu-item.danger:hover { background: #fde8e6; }
#asMenuOverlay { display: none; position: fixed; inset: 0; z-index: 9998; }
#asMenuOverlay.open { display: block; }
/* ── Delete confirmation modal ── */
.as-delete-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 10000; align-items: center; justify-content: center; }
.as-delete-backdrop.open { display: flex; }
.as-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); }
.as-delete-modal-icon { font-size: 28px; color: #c0392b; margin-bottom: 14px; }
.as-delete-modal h3 { font-size: 16px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; color: var(--ink); margin: 0 0 8px; }
.as-delete-modal p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.as-delete-modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.as-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; }
.as-delete-modal-btns .btn-cancel:hover { border-color: var(--ink); color: var(--ink); }
.as-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; }
.as-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: 1; min-width: 0; }
/* Dateline — when it was written and what it's about, at the head of the
   entry rather than crowded into the toolbar beside the tab that already
   names it. */
.entry-head { display: flex; align-items: baseline; gap: 16px; margin: 0 0 16px; min-width: 0; }
.entry-title { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.25; color: var(--ink); margin: 0; cursor: text; min-width: 0; overflow-wrap: anywhere; border-bottom: 1px dashed transparent; transition: border-color .14s ease; }
.entry-title:hover { border-bottom-color: var(--border); }
.entry-title.untitled { color: var(--whisper, #A7A096); font-weight: 400; }
.entry-title-input { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.25; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink); outline: none; padding: 0; min-width: 200px; flex: 1; }
.entry-head .editor-date-label { margin-left: auto; flex-shrink: 0; font-family: var(--serif); font-style: italic; font-size: 14.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
/* Topic as a box widget riding beside the title — sub-information, not a row. */
.topic-widget { align-self: center; flex-shrink: 0; display: inline-flex; align-items: center;
  border: 1px solid var(--border); background: var(--surface); padding: 0; }
.topic-widget .subject-input,
#section-journal .topic-widget .subject-input {
  appearance: none; -webkit-appearance: none; background: transparent; border: 0 !important;
  width: auto; max-width: 180px; padding: 5px 12px !important; cursor: pointer;
  font-family: var(--sans); font-size: 11px !important; font-weight: 600 !important;
  letter-spacing: 0.08em; text-transform: none; color: var(--ink) !important; }
.topic-widget select.subject-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='6'><path d='M1 1l3 3 3-3' fill='none' stroke='%236F6A62' stroke-width='1.4'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 26px !important; }
.topic-widget select.subject-input:has(option[value=""]:checked) { color: var(--muted) !important; font-weight: 500 !important; }
.topic-widget:hover { border-color: var(--whisper); }
#section-journal .topic-widget input.subject-input { width: 130px; }
/* Quiet meta rows — Topic, Derived from, Related share one voice. */
.em-row { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 0 7px; }
.em-lbl { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--muted); flex-shrink: 0; }
#section-journal .em-row .subject-input {
  font-family: var(--sans) !important;
  font-size: 13px !important; color: var(--ink-soft, #44413B) !important;
  background: none !important; border: 0 !important; padding: 0 !important;
  cursor: pointer; max-width: 30ch;
}
#section-journal .em-row .subject-input:hover { color: var(--accent) !important; }
#section-journal .em-row input.subject-input {
  border-bottom: 1px solid var(--border) !important; padding: 2px 0 !important; cursor: text;
}
/* Recent entries as tabs, filling the run between the topic and the mic
   cluster. The strip scrolls sideways past five; the gap before the actions
   keeps the tabs from crowding the mic. */
.entry-tabs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; margin: 0 28px 0 0; padding-left: 0; overflow-x: auto; scrollbar-width: none; }
.entry-tabs::-webkit-scrollbar { display: none; }
.entry-tab { flex-shrink: 0; max-width: 24ch; font-family: var(--sans); font-size: 13px; line-height: 1; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 11px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .14s ease; }
.entry-tab:hover { color: var(--ink); }
#entryTabMenu { position: fixed; z-index: 300; background: var(--card); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(27,27,27,.10); padding: 4px; }
#entryTabMenu .etm-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; font-family: var(--sans); font-size: 12.5px; color: var(--ink); padding: 8px 14px; cursor: pointer; text-align: left; }
#entryTabMenu .etm-item:hover { background: var(--surface); }
#entryTabMenu .etm-item i { font-size: 11px; color: var(--muted); }
.entry-tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.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; }
.btn-share.is-disabled { opacity: 0.5; cursor: not-allowed; }
.btn-private { 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-private:hover { color: var(--ink); border-color: var(--ink); }
.btn-private.on { color: var(--ink); border-color: var(--ink); background: var(--surface); }
.btn-private 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; }
.entry-private-pip { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-left: 6px; font-weight: 500; }
.entry-private-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} }
/* Save state stays on screen rather than flashing past. Colour carries the
   state; the icon repeats it, so it doesn't rely on colour alone. */
.saved-flash { display: none; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.saved-flash.show { display: inline-flex; }
.saved-flash i { font-size: 11px; }
.saved-flash.is-dirty { color: var(--muted); }
.saved-flash.is-dirty i { font-size: 8px; }
.saved-flash.is-saving { color: var(--muted); }
.saved-flash.is-saving i { animation: jsave-spin 1s linear infinite; }
.saved-flash.is-saved { color: var(--green); }
.saved-flash.is-error { color: var(--red, #b83232); }
@keyframes jsave-spin { to { transform: rotate(360deg); } }
/* 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-y: auto; overscroll-behavior: contain; padding: 14px 32px 18px; display: flex; flex-direction: column; background: var(--card); }
#editorContent { flex: 1 0 auto; 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; }
/* ── Guiding prompt — lavender caret disclosure ──
   Held together by a lavender left rule rather than a filled box: the tint
   is barely there, so it reads as a margin note on the entry instead of a
   panel sitting on top of it. */
.prompt-block { margin-bottom: 18px; flex-shrink: 0; border-left: 2px solid var(--purple); background: color-mix(in srgb, var(--purple) 4.5%, transparent); }
.prompt-toggle { display: flex; align-items: baseline; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-radius: 0; padding: 11px 18px 11px 15px; font-family: var(--sans); font-size: 12.5px; cursor: pointer; color: var(--purple); }
.prompt-car { align-self: center; font-size: 9px; color: var(--purple); opacity: 0.75; transition: transform 0.22s cubic-bezier(.4,0,.2,1); flex-shrink: 0; }
.prompt-toggle[aria-expanded="true"] .prompt-car { transform: rotate(90deg); opacity: 1; }
.prompt-toggle-l { font-size: 9.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--purple); opacity: 0.85; flex-shrink: 0; }
.prompt-toggle-v { font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.35; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-toggle-hint { margin-left: auto; font-size: 11.5px; color: var(--purple); opacity: 0.55; flex-shrink: 0; }
.prompt-toggle:hover .prompt-toggle-hint { opacity: 0.9; }
.prompt-toggle-v:not(:empty) ~ .prompt-toggle-hint,
.prompt-toggle[aria-expanded="true"] .prompt-toggle-hint { display: none; }
/* Height-animated so it unfolds rather than pops. */
.prompt-banner { display: grid; grid-template-rows: 0fr; background: none; border: 0; border-radius: 0; padding: 0; transition: grid-template-rows 0.26s cubic-bezier(.4,0,.2,1); }
.prompt-banner.visible { grid-template-rows: 1fr; }
.prompt-clip { overflow: hidden; min-height: 0; }
.prompt-edit { padding: 4px 18px 18px 15px; }
/* With a picker present the panel splits: writing left, suggestions right.
   :has() keeps it single-column when there is nothing to suggest, so the
   left side never sits against an empty gutter. */
.prompt-edit:has(#qlogPickWrap) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 360px); column-gap: clamp(28px, 4vw, 56px); align-items: start; }
.prompt-main { min-width: 0; }
/* Below this the suggestions column would squeeze the writing box to
   nothing, so it drops under the prose and keeps its rule as a divider. */
@media (max-width: 1080px) {
  .prompt-edit:has(#qlogPickWrap) { display: block; }
  #qlogPickWrap { border-left: 0; border-top: 1px solid var(--purple-hair); padding-left: 0; padding-top: 14px; margin-top: 16px; }
}
.prompt-text { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--ink); border: 1px solid var(--purple-hair); background: var(--card); resize: none; outline: none; width: 100%; box-sizing: border-box; min-height: 44px; padding: 12px 14px; display: block; }
.prompt-text:focus { border-color: var(--purple); }
.prompt-text::placeholder { color: var(--muted); font-style: italic; opacity: 0.7; }
.prompt-foot { display: flex; align-items: center; gap: 18px; margin-top: 11px; }
.prompt-save-btn { background: none; border: 1px solid var(--purple-hair); border-radius: 0; cursor: pointer; color: var(--purple); font-size: 11.5px; font-weight: 500; font-family: var(--sans); padding: 5px 14px; transition: border-color .14s ease, background .14s ease; }
.prompt-save-btn:hover { border-color: var(--purple); background: color-mix(in srgb, var(--purple) 8%, transparent); }
.prompt-dismiss { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11.5px; font-family: var(--sans); padding: 0; }
.prompt-dismiss:hover { color: var(--purple); }
/* Question-log picker, injected into the open panel by 26-questions.js. */
#qlogPickWrap { min-width: 0; border-left: 1px solid var(--purple-hair); padding-left: clamp(20px, 2.2vw, 30px); }
#qlogPickWrap .eq-pickhead { font-family: var(--sans); font-size: 9.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--purple); opacity: 0.75; margin: 18px 0 7px; }
#qlogPickWrap .eq-pickhead:first-child { margin-top: 0; }
#qlogPickWrap .eq-mrow { font-size: 14.5px; line-height: 1.5; border-bottom: 0; padding: 7px 10px; margin: 0 -10px; border-radius: 0; }
#qlogPickWrap .eq-mrow:hover { background: color-mix(in srgb, var(--purple) 9%, transparent); }
/* ── 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); }
/* Rich-text editor (contenteditable) */
#journalEditor.rte { flex: 1 0 auto; min-height: 260px; overflow-y: visible; width: 100%; background: transparent; border: none; padding: 0; font-family: var(--sans); font-size: 15px; line-height: 1.85; color: var(--ink); outline: none; box-sizing: border-box; }
#journalEditor.rte:empty::before { content: attr(data-placeholder); color: #b8af9e; pointer-events: none; }
#journalEditor.rte p { margin: 0 0 0.7em; }
#journalEditor.rte ul, #journalEditor.rte ol { margin: 0 0 0.7em; padding-left: 1.4em; }
#journalEditor.rte a { color: var(--accent); text-decoration: underline; }
#journalEditor.rte img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 6px 0; }
/* Note highlights painted with the CSS Custom Highlight API. */
::highlight(j-note) { background-color: rgba(255, 226, 138, 0.5); }
::highlight(j-note-ai) { background-color: rgba(122, 155, 196, 0.26); }
::highlight(j-note-ai-active) { background-color: rgba(103, 139, 183, 0.52); }
::highlight(j-note-active) { background-color: rgba(250, 190, 55, 0.85); }
/* Editor pane header — title + subtitle, New Entry on the right. */
#section-journal .editor-header { padding: 22px 32px 0; flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
#section-journal .editor-titlewrap { min-width: 0; }
#section-journal .editor-title { font-family: var(--serif); font-size: 28px; font-weight: 400; letter-spacing: -0.02em; color: var(--ink); margin: 0; line-height: 1.1; }
#section-journal .editor-sub { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 4px 0 0; line-height: 1.5; }
#section-journal .new-entry-btn.header-new { width: auto !important; flex: 0 0 auto !important; padding: 9px 16px !important; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; margin-top: 4px; }
/* The footer is a real sibling of .editor-scroll, not a sticky child of it.
   As a sticky child the writing ran underneath it — the editorial layer
   forced the bar transparent, so text showed straight through. */
.editor-foot { flex-shrink: 0; display: flex; flex-direction: column; background: var(--card); border-top: 1px solid var(--border); padding: 0 32px 6px; }
.editor-foot #journalAttachStrip { flex-shrink: 0; }
/* Attachments sit in one horizontal row above the toolbar and scroll
   sideways rather than stacking the footer taller. */
.editor-foot .ja-strip { flex-wrap: nowrap; overflow-x: auto; gap: 10px; margin: 12px 0 2px; padding-bottom: 2px; scrollbar-width: thin; }
.editor-foot .ja-tile { width: 62px; height: 62px; }
.editor-foot .ja-tile-doc i { font-size: 18px; }
.editor-foot .ja-tile-doc .ja-doc-name { font-size: 9px; }
#section-journal .format-bar { display: flex; align-items: center; gap: 4px; flex-shrink: 0; background: var(--card); }
#section-journal .fmt { background: none; border: none; cursor: pointer; width: 40px; height: 40px; border-radius: 0; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; transition: all 0.12s; }
#section-journal .fmt:hover { color: var(--ink); background: var(--surface); }
#section-journal .fmt-sep { width: 1px; height: 22px; background: var(--border); margin: 0 9px; }
#section-journal .format-bar .word-counter { margin-left: auto; margin-top: 0; }
/* Entries tab */
#section-journal .entries-toolbar { margin-bottom: 10px; }
#section-journal .entries-search { width: 100%; padding: 8px 11px; font-size: 12.5px; box-sizing: border-box; }
#section-journal .entries-filters { margin-bottom: 8px; }
#section-journal .entries-filters > summary { font-size: 11px; color: var(--muted); cursor: pointer; letter-spacing: 0.04em; padding: 4px 0; list-style: none; }
#section-journal .entries-filters > summary::-webkit-details-marker { display: none; }
#section-journal .entries-filters .log-filters { padding: 8px 0 4px; border: none; }
#section-journal .entries-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 6px 2px 8px; }
#section-journal #jrail-entries .entry-list { padding: 0; overflow: visible; }
#section-journal .viewall-btn { width: 100%; margin-top: 10px; background: none; border: 1px solid var(--border); border-radius: 0; padding: 9px; font-size: 12.5px; font-family: var(--sans); color: var(--ink); cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#section-journal .viewall-btn:hover { background: var(--surface); border-color: var(--ink); }
/* "Passage changed" badge for re-anchored notes whose quote was edited away. */
#section-journal .jnote-detached { display: inline-block; margin-left: 6px; font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; font-style: normal; vertical-align: middle; }
#section-journal .jnote-card.detached { opacity: 0.72; }
/* ── Linked entries badge ── */
.linked-entries-bar { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; align-items: stretch; }
.df-chain { display: flex; align-items: center; gap: 7px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.df-chain::-webkit-scrollbar { display: none; }
.df-node { flex-shrink: 0; font-size: 11.5px; font-family: var(--sans); color: var(--ink-soft, #44413B); background: var(--surface); border: 1px solid var(--border); padding: 3px 10px; cursor: pointer; white-space: nowrap; transition: border-color .14s ease; }
.df-node:hover { border-color: var(--ink); }
.df-node.now { background: transparent; border-color: var(--ink); color: var(--ink); font-weight: 600; cursor: default; }
.df-node.led { border-style: dashed; }
.df-arrow { color: var(--whisper, #A7A096); font-size: 12px; flex-shrink: 0; }
.df-led-lbl { font-size: 11px; color: var(--muted); font-family: var(--serif); font-style: italic; flex-shrink: 0; margin: 0 2px; }
.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: rgba(247, 168, 0, .85); background: rgba(255, 201, 41, 0.13); box-shadow: inset 3px 0 0 rgba(247, 168, 0, .85); }
.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(--ink); flex-shrink: 0; padding-right: 44px; }
.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:10px; }
.jnotes-hd-title { font-size:13.5px; font-weight:600; font-family:var(--sans); letter-spacing:-0.01em; color:var(--ink); }
.jnotes-hint { font-size:12.5px; color:var(--muted); margin-bottom:14px; line-height:1.6; }
/* The note composer — inline styles put a 13px box with 9px padding in a
   340px rail, which read as cramped. It gets real room now. */
.jnote-form { display: none; margin-bottom: 16px; }
.jnote-form.open { display: block; }
#section-journal .jnote-form textarea {
  width: 100%; box-sizing: border-box; min-height: 108px; resize: vertical;
  font-family: var(--sans) !important; font-size: 14px !important; line-height: 1.7 !important;
  color: var(--ink) !important; background: var(--card) !important;
  border: 1px solid var(--border) !important; border-radius: 0 !important;
  padding: 13px 15px !important; outline: none;
}
#section-journal .jnote-form textarea:focus { border-color: var(--ink) !important; }
#section-journal .jnote-form textarea::placeholder { color: var(--muted); font-style: italic; }
.jnote-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
#section-journal .jnote-cancel, #section-journal .jnote-save {
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  padding: 8px 16px !important; border-radius: 0 !important; cursor: pointer;
}
#section-journal .jnote-cancel { background: none !important; border: 1px solid var(--border) !important; color: var(--muted) !important; }
#section-journal .jnote-cancel:hover { color: var(--ink) !important; border-color: var(--ink) !important; }
#section-journal .jnote-save { background: var(--ink) !important; border: 1px solid var(--ink) !important; color: #fff !important; font-weight: 600 !important; -webkit-font-smoothing: subpixel-antialiased; }
.jnote-quote-preview { background:rgba(255,201,41,.14); border-left:3px solid var(--gold, #C9A227); border-radius:0; padding:11px 13px; font-size:13px; color:var(--ink-soft, var(--muted)); font-style:italic; margin-bottom:10px; line-height:1.6; }
.jnote-card { background:var(--card); border:1px solid var(--border); border-radius:0; padding:15px 17px; margin-bottom:12px; transition:border-color .14s ease; }
.jnote-card:hover { border-color:var(--ink); }
/* Yours = amber, the reading's = slate — the same code the text highlights
   speak, so a card and its passage always match. */
.jnote-card.has-quote:not(.ai-note) { border-left:3px solid rgba(255,201,41,.75); }
.jnote-card.ai-note { border-left:3px solid var(--accent); }
.jnote-card.ai-note .jnote-quote { border-left-color: rgba(110,125,145,.55); }
.jnote-card.ai-note .jnote-time { color: var(--accent); }
.jnotes-sub { display:flex; align-items:center; gap:7px; font-family:var(--sans); font-size:9.5px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; color:var(--accent); margin:18px 0 9px; padding-top:14px; border-top:1px solid var(--border); }
.jnotes-sub i { 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-family:var(--serif, Georgia, serif); font-size:13.5px; color:var(--ink-soft, var(--muted)); font-style:italic; margin-bottom:11px; padding:0 0 11px 11px; border-bottom:1px solid var(--border); border-left:2px solid rgba(255,201,41,.7); line-height:1.6; }
.jnote-text { font-size:14px; line-height:1.7; 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:12px; padding-top:10px; border-top:1px solid var(--hairline, rgba(27,25,22,.07)); }
.jnote-time { font-size:11.5px; color:var(--muted); }
/* Edit + delete sit together and stay quiet until the card is hovered, so a
   list of notes reads as writing rather than as a row of controls. */
.jnote-acts { display:flex; align-items:center; gap:2px; opacity:0; transition:opacity .14s ease; }
.jnote-card:hover .jnote-acts, .jnote-card.highlight-active .jnote-acts { opacity:1; }
.jnote-edit { background:none; border:none; cursor:pointer; color:var(--muted); font-size:13px; padding:4px 6px; border-radius:0; }
.jnote-edit:hover { color:var(--ink); }
.jnote-card.is-editing { cursor:default; }
.jnote-edit-wrap { margin-top:2px; }
#section-journal .jnote-edit-box {
  width:100%; box-sizing:border-box; min-height:104px; resize:vertical;
  font-family:var(--sans) !important; font-size:14px !important; line-height:1.7 !important;
  color:var(--ink) !important; background:var(--bg) !important;
  border:1px solid var(--border) !important; border-radius:0 !important;
  padding:12px 14px !important; outline:none;
}
#section-journal .jnote-edit-box:focus { border-color:var(--ink) !important; }
.jnote-del { background:none; border:none; cursor:pointer; color:var(--muted); font-size:13px; padding:4px 6px; border-radius:0; }
.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. */
/* Docs lives inside the editor column now, so the shell already draws the
   frame — the panel just fills the space the local editor was using. */
#cGdocsPanel { display:none; gap:0; flex:1; min-height:0; border:0; border-radius:0; 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); }
/* Lineage: main entry + derived dropdown in the entry log */
.el-lineage-toggle { background:none; border:1px solid var(--border); border-radius:999px; padding:2px 9px; font-size:10px; color:var(--accent); cursor:pointer; font-family:var(--sans); display:inline-flex; align-items:center; gap:4px; }
.el-lineage-toggle:hover { border-color:var(--accent); background:var(--surface); }
.el-lineage-toggle i { transition:transform .15s; font-size:9px; }
.el-lineage-toggle.is-open i { transform:rotate(180deg); }
.el-lineage-derived { margin:0 0 6px 22px; padding-left:14px; border-left:2px solid var(--border); }
.el-list-derived { background:var(--surface); }
.el-derived-prompt { font-size:11px; color:var(--accent); font-style:italic; margin:1px 0 4px; display:flex; align-items:center; gap:5px; }
.el-derived-prompt i { font-size:11px; opacity:.7; }
.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:baseline; gap:8px; margin-bottom:5px; }
.el-emotion-label { font-size:11px; color:var(--muted); width:70px; flex-shrink:0; text-transform:capitalize; }
.el-emotion-phrase { font-family:var(--serif); font-style:italic; font-size:13px; color:var(--ink); }
/* 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; }
/* The Drive list is a rail inside the column, so it reads narrower than
   it did when the panel owned the whole page width. */
#section-journal #cGdocsPanel .cGdocs-list-card { width:212px; }

.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:44px 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; }
/* Unified recent-row metadata: topic chip + tag chips (distinct from title/prompt). */
.jlog-topic { flex-shrink:0; font-size:11px; font-weight:500; letter-spacing:0.03em; color:var(--accent); background:color-mix(in srgb, var(--accent) 11%, transparent); border-radius:999px; padding:2px 9px; white-space:nowrap; }
.jlog-tags { display:flex; gap:5px; flex-shrink:0; overflow:hidden; }
.jlog-tag { font-size:10.5px; color:var(--muted); background:var(--surface); border:1px solid var(--border); border-radius:999px; padding:1px 8px; white-space:nowrap; }

/* ── In-app rich-text editor (Google Docs editing) ── */
.as-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; }
.as-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. */
.as-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; }
.as-rte-toolbar > button:not(.btn):hover { background:var(--surface); border-color:var(--ink); }
.as-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; }
.as-rte-color input { position:absolute; inset:0; opacity:0; cursor:pointer; }
/* Gray canvas that holds the page (Google Docs print-layout feel) */
.as-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 */
.as-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; }
.as-rte-surface h1 { font-size:22px; margin:0 0 10px; }
.as-rte-surface h2 { font-size:18px; margin:16px 0 8px; }
.as-rte-surface h3 { font-size:15px; margin:14px 0 6px; }
.as-rte-surface p { margin:0 0 10px; }
.as-rte-surface ul, .as-rte-surface ol { margin:0 0 10px; padding-left:24px; }
.as-rte-surface a { color:#1a73e8; }
/* Editable spreadsheet grid */
.as-grid-scroll { flex:1; min-height:0; overflow:auto; background:var(--card); }
.as-grid { border-collapse:collapse; width:max-content; min-width:100%; }
.as-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; }
.as-grid-cell:focus { background:var(--surface); box-shadow:inset 0 0 0 2px var(--accent); }
.as-grid tr:first-child .as-grid-cell { font-weight:600; background:var(--surface); }

/* ── Responsive (matches therapist breakpoints at 1300/1100) ── */
.journal-app.jp-dragging,
.journal-app.jp-noanim { transition: none; }
@media (max-width: 1300px) { .journal-app { grid-template-columns: 1fr var(--jp-aw, 340px); } }
@media (max-width: 900px)  { .journal-app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .analysis-panel { border-left: none; border-top: 1px solid var(--border); max-height: 46vh; } }

/* ── 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: var(--sans); font-weight: 500; letter-spacing: 0; 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; }

/* ── Messages v5 — correspondence thread (shared by client + clinician) ──
   Typographic blocks instead of bubbles: speaker label + rule color carry
   the voice; client/clinician anchors left, self anchors right (block
   floats right, text reads left). Session invites are attachment rows. */
.mv5-day { display: flex; align-items: center; gap: 16px; margin: 26px 0 2px; }
.mv5-day span { font-family: var(--serif, Georgia, serif); font-style: italic; font-size: 15px; color: var(--muted); flex-shrink: 0; }
.mv5-day::after { content: ""; flex: 1; border-top: 1px solid var(--border-light, var(--border)); }
.mv5 { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 0 2px; }
.mv5.you { align-items: flex-end; }
.mv5-in { max-width: 54ch; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.mv5-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 4px; }
.mv5-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.mv5.you .mv5-name { color: var(--accent); }
.mv5-time { font-size: 10.5px; color: var(--muted); }
.mv5-body { font-size: 13.5px; line-height: 1.6; color: var(--ink); border-left: 2px solid var(--border); padding-left: 13px; word-break: break-word; white-space: pre-wrap; }
.mv5.you .mv5-body { border-left-color: var(--accent); }
.mv5-body.retracted { color: var(--muted); font-style: italic; }
.mv5-meta { display: flex; gap: 12px; margin: 4px 0 0 15px; font-size: 10.5px; color: var(--muted); min-height: 13px; }
.mv5-read { opacity: 0.9; }
.mv5-act { cursor: pointer; opacity: 0; transition: opacity 0.12s ease; }
.mv5:hover .mv5-act { opacity: 1; }
.mv5-act:hover { color: var(--ink); }
.mv5-invite { display: inline-flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--card, var(--bg)); padding: 11px 14px; margin-left: 15px; }
.mv5-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: var(--ink); flex-shrink: 0; }
.mv5-itx { display: flex; flex-direction: column; line-height: 1.3; }
.mv5-it1 { font-size: 13px; font-weight: 600; color: var(--ink); }
.mv5-it2 { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.mv5-igo { margin-left: 8px; font-size: 11px; letter-spacing: 0.06em; font-weight: 600; padding: 7px 16px; border: none; background: var(--ink); color: var(--bg); cursor: pointer; flex-shrink: 0; }
.mv5-invite.ended { opacity: 0.62; }
.mv5-igo.ghost, .mv5-invite.ended .mv5-igo { background: transparent; border: 1px solid var(--border); color: var(--muted); font-weight: 500; cursor: default; }
.mv5-composer { border-top: 1px solid var(--border); padding: 12px 20px 8px; flex-shrink: 0; background: transparent; }
.mv5-input { width: 100%; box-sizing: border-box; border: none; background: transparent; font-family: var(--sans); font-size: 13.5px; line-height: 1.55; color: var(--ink); outline: none; resize: none; height: 42px; max-height: 120px; overflow-y: auto; padding: 3px 0; }
.mv5-input::placeholder { color: var(--muted); opacity: 0.7; }
.mv5-cfoot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 0 6px; }
.mv5-note { font-size: 10px; color: var(--muted); line-height: 1.45; }
.mv5-send { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; padding: 9px 20px; border: none; background: var(--ink); color: var(--bg); cursor: pointer; flex-shrink: 0; }

/* ── Question tags on a journal entry ───────────────────────────────
   The chips and their remove control (rendered by the Question Log
   integration in 10-journal.js) had no styles at all — the "×" was
   unstyled inline text, so there was no visible way to untag. */
.entry-questions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--purple-hair); }
.prompt-tagcount { font-size: 11px; color: var(--purple); opacity: .6; flex-shrink: 0; margin-left: auto; }
.prompt-tagcount:empty { display: none; }
.prompt-toggle[aria-expanded="true"] .prompt-tagcount { display: none; }
.entry-questions .eq-label { font-family: var(--sans); font-size: 9px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--purple); opacity: .7; margin-right: 2px; }
.eq-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif, Georgia, serif); font-style: italic; font-size: 13px; line-height: 1.3; color: var(--ink); background: var(--surface, rgba(0,0,0,0.03)); border: 1px solid var(--border); padding: 6px 10px 6px 12px; max-width: 46ch; }
.eq-x { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; flex-shrink: 0; font-family: var(--sans); font-style: normal; font-size: 13px; line-height: 1; color: var(--muted); border: 1px solid transparent; cursor: pointer; transition: color .14s ease, border-color .14s ease, background .14s ease; }
.eq-x:hover { color: var(--ink); border-color: var(--border); background: var(--card); }
.eq-add { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 500; color: var(--purple); background: color-mix(in srgb, var(--purple) 7%, transparent); border: 1px solid var(--purple-hair); padding: 6px 13px; cursor: pointer; transition: background .14s ease, border-color .14s ease; }
.eq-add:hover { background: color-mix(in srgb, var(--purple) 14%, transparent); border-color: var(--purple); }
.eq-menu { display: flex; flex-direction: column; min-width: 260px; max-width: 420px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 14px 34px -16px rgba(31,61,82,0.30); }
.eq-mrow { font-family: var(--serif, Georgia, serif); font-style: italic; font-size: 13px; color: var(--ink); padding: 10px 13px; cursor: pointer; border-bottom: 1px solid var(--border); }
.eq-mrow:last-child { border-bottom: 0; }
.eq-mrow:hover { background: var(--surface, rgba(0,0,0,0.04)); }

/* A tab stop inside the writing area — fixed width so it behaves like a real
   tab wherever the caret is, and deletes as one unit. */
#section-journal .rte .j-tab { display: inline-block; width: 40px; white-space: pre; }

/* ── Doors out of a reading ──
   Every observation ends in a real button, not a text link: Write on This
   opens a fresh linked entry guided by the observation; Keep files one of
   its questions into the Question Log. Sage = the quiet action you can
   take, same as Mark All As Read and the Questions rail's Keep. */
.ac-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--hairline, rgba(27,25,22,.07)); }
.ac-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--green, #5A6B57); background: var(--green-light, #E8ECDF);
  border: 1px solid color-mix(in srgb, var(--green, #5A6B57) 30%, transparent);
  border-radius: 0; padding: 7px 14px; cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.ac-btn:hover { border-color: var(--green, #5A6B57); }
.ac-btn i { font-size: 12px; }
/* The fuller button label sits under its question — beside it, the two
   fought for a 340px rail. */
.ac-q { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin-bottom: 12px; }
.ac-q:last-child { margin-bottom: 0; }
.ac-q-t { flex: 1; min-width: 0; line-height: 1.55; }
.ac-keep {
  flex-shrink: 0;
  font-family: var(--sans); font-size: 11.5px; font-weight: 500;
  color: var(--green, #5A6B57); background: var(--green-light, #E8ECDF);
  border: 1px solid color-mix(in srgb, var(--green, #5A6B57) 30%, transparent);
  border-radius: 0; padding: 4px 12px; cursor: pointer;
  transition: border-color .14s ease;
}
.ac-keep:hover { border-color: var(--green, #5A6B57); }
/* No transition once kept — Safari can blend old and new label rasters
   mid-transition, which reads as ghosted double text. */
.ac-keep[disabled] { opacity: .6; cursor: default; transition: none; }

/* ── Open Entry picker: topic folders, then entries ── */
.jp-head-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.jp-back { border: 1px solid var(--border); background: var(--surface); color: var(--ink); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; flex-shrink: 0; transition: border-color .14s ease; }
.jp-back:hover { border-color: var(--ink); }
.jp-back[hidden] { display: none; }
.jp-folder .jp-folder-ico { display: block; font-size: 20px; color: var(--muted); margin-bottom: 8px; }
.jp-folder:hover .jp-folder-ico { color: var(--ink); }
