.documents-content-wrapper { width: 100%; }

.doc-row-mood {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--subtle-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  flex-shrink: 0;
}
.doc-row-mood i { font-size: 13px; color: var(--user-accent, var(--text-primary)); }

.floating-toolbar-dock {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
  pointer-events: none;
}

.floating-toolbar-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.floating-toolbar-scroll {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  max-width: calc(100vw - 96px);
}
.floating-toolbar-scroll::-webkit-scrollbar { display: none; }

.ftool-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
  position: relative;
}
.ftool-btn i { font-size: 16px; }
.ftool-btn:active { transform: scale(0.9); }
.ftool-btn:hover { background: var(--subtle-bg); }
.ftool-btn.active-format { background: var(--user-accent, var(--text-primary)); color: #ffffff; }
.ftool-btn.voice-listening { background: #ff3b30; color: #ffffff; animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,48,0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255,59,48,0); }
}

.ftool-mini {
  position: absolute;
  bottom: 3px;
  right: 3px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  font-family: 'Poppins', sans-serif;
}

.ftool-divider {
  flex-shrink: 0;
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 3px;
}

.ftool-more-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--subtle-bg);
  color: var(--text-secondary);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 2px;
}
.ftool-more-btn i { font-size: 16px; }

@media (max-width: 420px) {
  .floating-toolbar-scroll { max-width: calc(100vw - 108px); }
}

.editor-screen {
  background: var(--bg-color, var(--subtle-bg));
}

.editor-header-layout {
  padding: 14px 16px 10px;
}

.editor-body-container {
  width: 100%;
  flex: 1;
  background: var(--card-bg);
  border-radius: 28px;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.07);
  padding: 20px 20px 4px;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-journal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 12px;
  flex-wrap: wrap;
}
.editor-journal-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-journal-date i { font-size: 14px; color: var(--user-accent, var(--text-primary)); }
.editor-word-count {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.editor-streak-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  color: #ff9500; background: rgba(255, 149, 0, 0.1); border-radius: 9999px; padding: 3px 10px;
}
.editor-streak-chip i { font-size: 13px; }

.editor-body {
  width: 100%;
  flex: 1;
  background: transparent;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  outline: none;
  min-height: 350px;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding-bottom: 90px;
}

.editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--text-secondary);
  pointer-events: none;
}

.editor-body h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 14px 0 8px;
  color: var(--text-primary);
}

.editor-body blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--user-accent, var(--text-primary));
  color: var(--text-secondary);
  font-style: italic;
  background: var(--subtle-bg);
  border-radius: 0 14px 14px 0;
}

.editor-body pre {
  background: var(--subtle-bg);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  overflow-x: auto;
  margin: 10px 0;
}

.editor-body ul, .editor-body ol {
  padding-left: 22px;
  margin: 8px 0;
}

.editor-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

.content-redacted {
  position: relative;
  color: transparent;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 2px;
  outline: none;
}
.content-redacted::before {
  content: "";
  position: absolute;
  inset: 1px -2px;
  background: #17171a;
  border-radius: 4px;
}
.content-redacted::after {
  content: "\1F512";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  opacity: 0.7;
}
.content-redacted.revealed {
  color: #ff3b30;
  font-weight: 600;
}
.content-redacted.revealed::before,
.content-redacted.revealed::after {
  display: none;
}

.editor-inline-image {
  max-width: 100%;
  border-radius: 18px;
  margin: 10px 0;
  display: block;
}

.editor-location-chip, .editor-timestamp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--subtle-bg);
  color: var(--text-primary);
  border-radius: 9999px;
  padding: 4px 12px 4px 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
}
.editor-location-chip i, .editor-timestamp-chip i {
  font-size: 13px;
  color: var(--user-accent, var(--text-primary));
}

.editor-mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--subtle-bg);
  color: var(--text-primary);
  border-radius: 9999px;
  padding: 4px 12px 4px 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
}
.editor-mood-chip .mood-chip-icon-circle {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--user-accent, var(--text-primary));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.editor-mood-chip .mood-chip-icon-circle i { font-size: 11px; color: #ffffff; }

.editor-location-snippet {
  display: inline-block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: 6px;
  letter-spacing: 0.2px;
}

.editor-bottom-pill-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 3200;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.editor-bottom-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  transition: transform 0.15s ease;
}
.editor-bottom-pill:active { transform: scale(0.95); }
.editor-bottom-pill i { font-size: 16px; color: var(--user-accent, var(--text-primary)); flex-shrink: 0; }
.editor-bottom-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mood-pill-icon-circle {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--subtle-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.2s ease;
}
.mood-pill-icon-circle i { font-size: 13px; color: var(--text-secondary); transition: color 0.2s ease; }
#editor-mood-pill.has-mood .mood-pill-icon-circle { background: var(--user-accent, var(--text-primary)); }
#editor-mood-pill.has-mood .mood-pill-icon-circle i { color: #ffffff; }

.mood-picker-popover {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%) translateY(10px) scale(0.95);
  z-index: 3300;
  display: flex;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 8px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.14);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
}
.mood-picker-popover.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}
.mood-option {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--subtle-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
}
.mood-option i { font-size: 17px; color: var(--text-secondary); transition: color 0.2s ease; }
.mood-option:active { transform: scale(0.88); }
.mood-option.active { background: var(--user-accent, var(--text-primary)); }
.mood-option.active i { color: #ffffff; }

.editor-topbar { gap: 10px; }
.editor-topbar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.editor-icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent;
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.editor-icon-btn:hover { background: var(--subtle-bg); color: var(--text-primary); }
.editor-icon-btn:active { transform: scale(0.9); }
#editor-delete-btn:hover { color: #ff3b30; background: rgba(255,59,48,0.1); }
.editor-icon-btn.is-active { color: var(--user-accent); background: rgba(0,0,0,0.06); }

.text-tools-bar {
  border-radius: 9999px;
  padding: 6px 10px;
}

.text-tool-btn {
  border-radius: 9999px;
}

.toolbar-morph-container {
  margin-top: 8px;
}