/* Journal library and editor. Scoped to .jnl-* plus a few overrides
   on the shared affirmation chips when they sit inside the journal. */

#jnlCats .aff-cat.active {
  background: rgba(3,165,193,.14);
  border-color: var(--teal);
  color: #07788c;
}

.jnl-featured-theme {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.jnl-textbtn {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: none;
  color: var(--teal);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.jnl-write {
  flex-shrink: 0;
  border: 0;
  background: rgba(3,165,193,.12);
  color: #07788c;
  font-weight: 700;
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
}

.jnl-entries-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.jnl-blank {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(20,75,191,.08);
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}

.jnl-draft {
  background: rgba(3,165,193,.08);
  border: 1px solid rgba(3,165,193,.25);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.jnl-draft p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--ink);
}

.jnl-day {
  margin-top: 12px;
}

.jnl-day h4 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 14px;
  color: var(--navy);
  margin: 0 0 8px;
}

.jnl-entry {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg);
  -webkit-user-select: text;
  user-select: text;
}

.jnl-entry-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.jnl-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.jnl-tag {
  font-size: 11px;
  font-weight: 700;
  color: #07788c;
  background: rgba(3,165,193,.12);
  border-radius: 999px;
  padding: 2px 8px;
}

.jnl-edited {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.jnl-entry-prompt {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.4;
  margin: 0 0 6px;
}

.jnl-entry-body {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.jnl-entry-actions,
.jnl-confirm {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.jnl-entry-actions button,
.jnl-confirm button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}

.jnl-confirm p {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.jnl-confirm button[data-action="confirm-delete"] {
  color: #9a3d55;
  border-color: rgba(217,138,158,.6);
}

.jnl-empty {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  padding: 4px 0 2px;
}

.jnl-editor {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--surface);
  display: none;
  flex-direction: column;
}

.jnl-editor.open { display: flex; }

.jnl-editor-head {
  padding: 36px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.jnl-editor-back {
  border: 0;
  background: rgba(3,165,193,.09);
  color: #07788c;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}

.jnl-editor-head h3 {
  font-family: 'Libre Baskerville', Georgia, serif;
  color: var(--navy);
  font-size: 19px;
  margin: 0 0 6px;
}

.jnl-editor-prompt {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 15px;
  color: var(--navy);
  line-height: 1.45;
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.jnl-support {
  font-size: 12.5px;
  line-height: 1.45;
  color: #9a3d55;
  background: rgba(217,138,158,.12);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0 0;
}

#jnlSubs { margin-top: -4px; }

.ci-qwrap { margin: 0 0 12px; }
.ci-qwrap .ci-q { display: block; font-size: 14px; font-weight: 650; color: var(--navy); margin-bottom: 6px; }
.ci-qwrap textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  resize: vertical;
}
.ci-item { border-top: 1px solid var(--border); padding: 10px 0; }
.ci-item:first-child { border-top: 0; }
.ci-item .ci-a { font-size: 14px; white-space: pre-wrap; margin: 2px 0 8px; }

.jnl-editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 8px;
  display: flex;
  flex-direction: column;
}

.jnl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.jnl-editor textarea {
  width: 100%;
  flex: 1;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  resize: none;
}

.jnl-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.jnl-error {
  color: #9a3d55;
  font-size: 13px;
  margin: 8px 0 0;
}

.jnl-private {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}

.jnl-editor-actions {
  padding: 10px 20px 16px;
  border-top: 1px solid var(--border);
}

.jnl-editor-actions .btn-primary:disabled {
  opacity: .6;
  cursor: default;
}
