/* ── JOURNAL PANEL ──────────────────────────────────────────────────────────── */

#journalPanel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.28s ease;
}
#journalPanel.open { transform: translateX(0); }

/* ── HEADER ── */
.journal-header {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px 0 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.journal-tabs {
  display: flex;
  flex: 1;
}

.journal-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 16px 20px 13px;
  font-family: Georgia, serif;
  font-size: 1rem;
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.journal-tab:hover { color: var(--ink); }
.journal-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.journal-close-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink-light);
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.journal-close-btn:hover { background: rgba(200,169,110,0.12); color: var(--ink); }

/* ── PANES ── */
.journal-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ── PANE TOOLBAR ── */
.journal-pane-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(200,169,110,0.2);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.journal-sort-label {
  font-family: Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  opacity: 0.7;
}

.journal-sort-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-light);
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.journal-sort-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.journal-sort-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--parchment);
  font-weight: 600;
}

.journal-new-btn {
  background: var(--gold);
  color: var(--parchment);
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.journal-new-btn:hover { opacity: 0.88; }

.journal-search-input {
  flex: 1;
  min-width: 120px;
  background: rgba(200,169,110,0.08);
  border: 1px solid rgba(200,169,110,0.3);
  border-radius: 4px;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  padding: 5px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.journal-search-input:focus { border-color: var(--gold); }
.journal-search-input::placeholder { color: var(--ink-light); opacity: 0.5; }

/* ── LIST ── */
.journal-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.journal-loading,
.journal-empty {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-light);
  opacity: 0.6;
  text-align: center;
  padding: 40px 20px;
  line-height: 1.7;
}

.journal-signin-prompt {
  text-align: center;
  padding: 50px 24px;
  font-family: Arial, sans-serif;
}
.journal-signin-prompt p {
  color: var(--ink-light);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.6;
}
.journal-signin-btn {
  background: var(--gold);
  color: var(--parchment);
  border: none;
  padding: 10px 22px;
  border-radius: 5px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}
.journal-signin-btn:hover { opacity: 0.88; }

/* ── SCRIPTURE NOTE ITEMS ── */
.journal-note-item {
  border-left: 3px solid var(--border);
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 0 4px 4px 0;
  background: rgba(200,169,110,0.04);
  transition: border-color 0.15s;
}
.journal-note-item:hover { border-left-color: var(--gold); }

.journal-note-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.journal-note-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.journal-note-ref {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold-light);
  flex: 1;
}

.journal-note-date {
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  color: var(--ink-light);
  opacity: 0.6;
  white-space: nowrap;
}

.journal-note-text {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 8px;
}
.journal-no-text {
  opacity: 0.45;
  font-style: italic;
}

/* ── JOURNAL ENTRY ITEMS ── */
.journal-entry-item {
  border-left: 3px solid var(--border);
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 0 4px 4px 0;
  background: rgba(200,169,110,0.04);
  transition: border-color 0.15s;
}
.journal-entry-item:hover { border-left-color: var(--gold); }

.journal-entry-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.journal-entry-title {
  font-family: Georgia, serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.journal-entry-date {
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  color: var(--ink-light);
  opacity: 0.6;
  white-space: nowrap;
}

.journal-entry-excerpt {
  font-family: Georgia, serif;
  font-size: 0.84rem;
  color: var(--ink-light);
  line-height: 1.55;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

/* ── SHARED ACTION BUTTONS ── */
.journal-note-actions {
  display: flex;
  gap: 8px;
}
.journal-go-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.journal-go-btn:hover { background: rgba(200,169,110,0.12); border-color: var(--gold); }
.journal-del-btn {
  background: none;
  border: 1px solid rgba(192,80,128,0.3);
  color: #c05080;
  font-family: Arial, sans-serif;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.journal-del-btn:hover { background: rgba(192,80,128,0.1); border-color: #c05080; }

/* ── INLINE EDITOR ── */
.journal-editor {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.journal-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(200,169,110,0.2);
  flex-shrink: 0;
}

.journal-editor-back {
  background: none;
  border: none;
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}
.journal-editor-back:hover { background: rgba(200,169,110,0.12); }

.journal-editor-date {
  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  color: var(--ink-light);
  opacity: 0.55;
}

.journal-editor-title {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(200,169,110,0.25);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 16px;
  outline: none;
  flex-shrink: 0;
}
.journal-editor-title::placeholder { color: var(--ink-light); opacity: 0.4; }

.journal-editor-body {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.75;
  padding: 16px;
  outline: none;
  resize: none;
  overflow-y: auto;
}
.journal-editor-body::placeholder { color: var(--ink-light); opacity: 0.35; }

.journal-editor-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid rgba(200,169,110,0.2);
  flex-shrink: 0;
}

.journal-editor-save {
  background: var(--gold);
  color: var(--parchment);
  border: none;
  padding: 8px 22px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.journal-editor-save:hover { opacity: 0.88; }
.journal-editor-save:disabled { opacity: 0.5; cursor: not-allowed; }

.journal-editor-delete {
  background: none;
  border: 1px solid rgba(192,80,128,0.4);
  color: #c05080;
  padding: 7px 16px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}
.journal-editor-delete:hover { background: rgba(192,80,128,0.1); }

/* ── LIGHT MODE ── */
body.light-mode .journal-note-item,
body.light-mode .journal-entry-item {
  background: rgba(60,40,0,0.03);
}
body.light-mode .journal-search-input {
  background: rgba(60,40,0,0.05);
  border-color: rgba(60,40,0,0.2);
}

/* ── VERSE UNDERLINE FOR NOTES ── */
.verse-wrap.has-note {
  text-decoration: underline dotted;
  text-decoration-thickness: 2px;
}
.verse-wrap[data-note-color="gold"]  { text-decoration-color: #c8920a; }
.verse-wrap[data-note-color="blue"]  { text-decoration-color: #3a7bd5; }
.verse-wrap[data-note-color="green"] { text-decoration-color: #4a9a5a; }
.verse-wrap[data-note-color="pink"]  { text-decoration-color: #c05080; }
.verse-wrap[data-note-color="none"]  { text-decoration-color: rgba(128,128,128,0.45); }
