/* Reset & Global Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #ffffff;
  color: #1a1a1a;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 45% 35% at 90% 90%, rgba(154, 212, 223, 0.28), transparent 70%),
    radial-gradient(ellipse 35% 25% at 10% 95%, rgba(186, 230, 238, 0.18), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* -------------------------------------------
   Proximity Slide-Out Left Drawer
------------------------------------------- */
.sidebar-trigger {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 100vh;
  z-index: 99;
  cursor: pointer;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 290px;
  height: 100vh;
  background-color: #fcfcfd;
  border-right: 1px solid #e5e5e7;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.06);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.sidebar-inner {
  padding: 16px 10px 16px 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.workspace-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #71717a;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* More Options "..." Button */
.options-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.8rem;
  color: #71717a;
  letter-spacing: 1px;
  line-height: 1;
  transition: all 0.15s ease;
}

.options-btn:hover {
  background-color: #f4f4f5;
  color: #18181b;
}

.pin-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 3px 5px;
  font-size: 0.8rem;
  filter: grayscale(1);
  opacity: 0.45;
  transition: all 0.15s ease;
}

.pin-btn:hover {
  opacity: 0.8;
  background-color: #f4f4f5;
}

.pin-btn.active {
  filter: none;
  opacity: 1;
  background-color: rgba(154, 212, 223, 0.25);
  border-color: #9AD4DF;
}

.drawer-handle {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 12px;
  height: 52px;
  background-color: #d4d4d8;
  border: 1px solid #e5e5e7;
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease, width 0.2s ease;
}

.sidebar-drawer:hover .drawer-handle,
.sidebar-drawer.open .drawer-handle,
.sidebar-drawer.pinned .drawer-handle,
.sidebar-trigger:hover + .sidebar-drawer .drawer-handle {
  opacity: 0;
  pointer-events: none;
}

.sidebar-trigger:hover + .sidebar-drawer,
.sidebar-drawer:hover,
.sidebar-drawer.open,
.sidebar-drawer.pinned {
  transform: translateX(0);
}

.btn-create-post {
  background-color: #18181b;
  color: #ffffff;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 24px;
  text-align: left;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn-create-post:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  margin-top: 4px;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a1a1aa;
  margin-bottom: 12px;
  display: block;
}

/* -------------------------------------------
   Hide Scrollbars Across Sidebar & Views
------------------------------------------- */
.sidebar-section,
.sidebar-tree,
.settings-scroll-container,
.comments-feed {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
}

.sidebar-section::-webkit-scrollbar,
.sidebar-tree::-webkit-scrollbar,
.settings-scroll-container::-webkit-scrollbar,
.comments-feed::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.thread-list {
  list-style: none;
}

.thread-list li {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: background-color 0.15s ease;
}

.thread-list li:hover {
  background-color: #f0f0f2;
}

.thread-list li.active {
  background-color: #ebebee;
}

.thread-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: #18181b;
  line-height: 1.35;
  margin-bottom: 4px;
}

.thread-time {
  font-size: 0.72rem;
  color: #a1a1aa;
}

.switch-zone-btn {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #18181b;
}

/* -------------------------------------------
   Top Minimal Bar
------------------------------------------- */
.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 24px 40px;
}

.top-editor-btn {
  background: transparent;
  border: 1px solid #e4e4e7;
  font-size: 0.88rem;
  font-weight: 600;
  color: #18181b;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.top-editor-btn:hover {
  background-color: #f4f4f5;
  border-color: #d4d4d8;
}

.top-switch-btn {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #18181b;
  background-color: #f4f4f5;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.top-switch-btn:hover {
  background-color: #e4e4e7;
}

/* -------------------------------------------
   Right Block Library Drawer
------------------------------------------- */
.blocks-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background-color: #ffffff;
  border-left: 1px solid #e5e5e7;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.04);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.blocks-drawer.open {
  transform: translateX(0);
}

.blocks-drawer-inner {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blocks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.blocks-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #18181b;
}

.close-editor-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #71717a;
}

.blocks-sub {
  font-size: 0.8rem;
  color: #71717a;
  margin-bottom: 24px;
  line-height: 1.45;
}

.block-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: auto;
}

.draggable-tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: grab;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 500;
  color: #1e293b;
  transition: all 0.15s ease;
  user-select: none;
}

.draggable-tool-item:active {
  cursor: grabbing;
}

.draggable-tool-item:hover {
  background-color: #f1f5f9;
  border-color: #9AD4DF;
  transform: translateX(-3px);
}

.tool-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.btn-publish {
  background-color: #18181b;
  color: #ffffff;
  border: none;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-publish:hover {
  opacity: 0.85;
}

/* -------------------------------------------
   Reading Stage Left Shift (Balanced)
------------------------------------------- */
.reading-stage {
  max-width: 720px;
  margin: 20px auto 140px auto;
  padding: 0 24px;
  transition: transform 0.58s cubic-bezier(0.16, 1, 0.3, 1);
}

.reading-stage.shifted {
  transform: translateX(-180px); /* Balanced reading position */
}

/* -------------------------------------------
   In-Page Drag Canvas & Cells
------------------------------------------- */
.editor-stage {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease,
              margin-bottom 0.5s ease;
}

.editor-stage.active {
  max-height: 4000px;
  opacity: 1;
  margin-bottom: 60px;
}

.editor-card {
  background: #ffffff;
  border: 1.5px solid #9AD4DF;
  border-radius: 12px;
  padding: 32px 30px;
  box-shadow: 0 12px 35px -8px rgba(154, 212, 223, 0.25);
}

.canvas-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Base Canvas Row */
.canvas-row {
  position: relative;
  width: 100%;
}

/* Multi-Column Container Architecture (16px center gutter) */
.column-container {
  display: grid;
  grid-template-columns: calc(50% - 8px) 16px calc(50% - 8px);
  gap: 0;
  position: relative;
  align-items: start;
  width: 100%;
}

.column-lane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 60px;
  border-radius: 6px;
  position: relative;
}

.column-lane.drop-active {
  background-color: rgba(154, 212, 223, 0.08);
}

/* Central Draggable Splitter */
.column-resizer {
  width: 16px;
  align-self: stretch;
  cursor: col-resize;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  z-index: 20;
}

.column-resizer::after {
  content: '';
  width: 2px;
  height: 100%;
  background-color: #e2e8f0;
  border-radius: 1px;
  transition: background-color 0.15s ease, width 0.15s ease;
}

.column-resizer:hover::after,
.column-resizer.is-resizing::after {
  background-color: #0284c7;
  width: 3px;
}

/* Cell Wrapper */
.cell-wrapper {
  position: relative;
  width: 100%;
  border-radius: 6px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cell-wrapper.is-dragging {
  opacity: 0.25;
}

/* -------------------------------------------
   Consolidated Cell Action Pill (Option 5)
------------------------------------------- */
.cell-action-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  padding: 2px 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 15;
}

/* Reveal pill on cell hover */
.cell-wrapper:hover .cell-action-pill {
  opacity: 1;
  pointer-events: auto;
}

/* Auto-fade pill when typing/focused, UNLESS hovering over the pill itself */
.cell-wrapper:focus-within .cell-action-pill {
  opacity: 0;
  pointer-events: none;
}

.cell-wrapper .cell-action-pill:hover {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Drag Handle inside Pill */
.drag-handle {
  color: #71717a;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.drag-handle:hover {
  background-color: #f4f4f5;
  color: #09090b;
}

.drag-handle:active,
.cell-wrapper.is-dragging .drag-handle {
  color: #0284c7;
  cursor: grabbing;
}

/* Delete Button inside Pill */
.cell-del-btn {
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cell-del-btn:hover {
  background-color: #fef2f2;
  color: #ef4444;
}

/* Drop Indicators */
.canvas-drop-line {
  display: none;
  height: 3px;
  background-color: #0284c7;
  border-radius: 2px;
  margin: 6px 0;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
  pointer-events: none;
  z-index: 50;
}

.canvas-drop-line.visible {
  display: block;
}

/* Side Flank Drop Lines */
.canvas-row.col-drop-left::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 3px;
  background-color: #0284c7;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
  pointer-events: none;
  z-index: 50;
}

.canvas-row.col-drop-right::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: -8px;
  width: 3px;
  background-color: #0284c7;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
  pointer-events: none;
  z-index: 50;
}

/* Published Grid Row */
.published-column-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
  align-items: start;
}

.published-column-lane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Editable Cell Typographies */
.editable-cell {
  outline: none;
  border: 1px dashed transparent;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 38px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.editable-cell:focus,
.editable-cell:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.editable-cell:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.cell-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.cell-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #334155;
}

.cell-callout {
  background-color: #f8fafc;
  border-left: 3px solid #9AD4DF !important;
  font-size: 0.95rem;
  color: #1e293b;
  padding: 12px 16px;
}

.cell-quote {
  font-size: 1.2rem;
  font-style: italic;
  border-left: 2px solid #0f172a !important;
  padding-left: 14px;
  color: #0f172a;
}

.cell-media-slot {
  background-color: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 30px 16px;
  text-align: center;
}

.media-upload-dummy {
  font-size: 0.85rem;
  color: #64748b;
  cursor: pointer;
  margin-bottom: 8px;
}

.cell-caption {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
}

/* -------------------------------------------
   Post Feed & Highlightable Blocks
------------------------------------------- */
.post-canvas {
  max-width: 720px;
  width: 100%;
}

.doc-block {
  position: relative;
  padding: 16px 20px;
  margin: -16px -20px 24px -20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.doc-block:hover {
  background-color: rgba(154, 212, 223, 0.08);
  border-color: rgba(154, 212, 223, 0.35);
}

.comment-bubble {
  position: absolute;
  left: -38px; /* Moved to left side to avoid drawer overlap */
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
  color: #71717a;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
}

.doc-block:hover .comment-bubble {
  opacity: 1;
  transform: translateY(-50%) translateX(-12px);
}

.block-header {
  margin-bottom: 32px;
}

.post-heading {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: #09090b;
  margin-bottom: 12px;
}

.post-meta {
  font-size: 0.85rem;
  color: #71717a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.separator {
  color: #d4d4d8;
}

.block-text p {
  color: #27272a;
  font-size: 1.1rem;
  line-height: 1.75;
}

/* Editor Metadata Preview */
.editor-post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #71717a;
  margin-top: 8px;
  margin-bottom: 20px;
  padding-left: 10px;
  user-select: none;
}

/* Dual-Zone Media Selector Card */
.media-slot-container {
  background-color: #fafafa;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease;
}

.media-slot-container:hover {
  border-color: #9AD4DF;
}

.media-picker-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 120px;
}

.picker-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  color: #52525b;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.picker-zone:hover {
  background-color: #f1f5f9;
  color: #09090b;
}

.picker-zone.upload-zone {
  border-right: 1px dashed #e2e8f0;
}

.picker-icon {
  font-size: 1.4rem;
}

/* Embed Input Bar */
.embed-input-bar {
  display: none;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  flex-direction: column;
  gap: 10px;
}

.embed-input-bar.active {
  display: flex;
}

.embed-field-row {
  display: flex;
  gap: 8px;
}

.embed-url-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.embed-url-input:focus {
  border-color: #9AD4DF;
}

.btn-confirm-embed, .btn-cancel-embed {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-confirm-embed {
  background-color: #18181b;
  color: #ffffff;
}

.btn-cancel-embed {
  background-color: #f4f4f5;
  color: #71717a;
}

/* Active Rendered Media Preview Containers */
.rendered-media-wrapper {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000000;
}

.rendered-media-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.rendered-media-wrapper video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 520px;
}

.rendered-media-wrapper iframe {
  width: 100%;
  border: none;
  display: block;
}

.rendered-media-wrapper iframe.video-frame {
  aspect-ratio: 16 / 9;
  height: auto;
}

.rendered-media-wrapper iframe.pdf-frame,
.rendered-media-wrapper object.pdf-frame {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
  background-color: #ffffff;
}

/* Overlay Replace Button */
.btn-replace-media {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(24, 24, 27, 0.85);
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.15s ease;
  z-index: 10;
}

.rendered-media-wrapper:hover .btn-replace-media {
  opacity: 1;
}

.btn-replace-media:hover {
  background-color: #000000;
}

/* Dynamic Crop Button */
.cell-crop-btn {
  background: transparent;
  border: none;
  color: #71717a;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cell-crop-btn:hover {
  background-color: #f4f4f5;
  color: #09090b;
}

/* Image Marquee Workspace */
.image-cropper-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background-color: #09090b;
  user-select: none;
}

.image-cropper-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Dark Shading Mask */
.crop-overlay-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 25;
}

.crop-overlay-mask.active {
  display: block;
}

/* Interactive Crop Box */
.crop-selection-box {
  position: absolute;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  border: 1.5px solid #9AD4DF;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  z-index: 30;
}

/* Corner Resize Grip */
.crop-resize-handle {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  background-color: #9AD4DF;
  border: 2px solid #09090b;
  border-radius: 2px;
  cursor: nwse-resize;
}

/* Floating Action Bar (Apply / Cancel) */
.crop-action-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 6px 14px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 40;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.crop-action-bar.active {
  display: flex;
}

.btn-apply-crop {
  background: #9AD4DF;
  color: #09090b;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.btn-apply-crop:hover {
  background: #b2e4ed;
}

.btn-cancel-crop {
  background: transparent;
  color: #a1a1aa;
  border: none;
  font-size: 0.75rem;
  padding: 4px 8px;
  cursor: pointer;
}

.btn-cancel-crop:hover {
  color: #ffffff;
}

/* -------------------------------------------
   Active Document Block Highlight
------------------------------------------- */
.doc-block.active-discussion-target {
  background-color: rgba(154, 212, 223, 0.12) !important;
  border-color: rgba(154, 212, 223, 0.6) !important;
  box-shadow: 0 0 0 1px rgba(154, 212, 223, 0.4);
}

/* -------------------------------------------
   Seamless Discussion Drawer (420px Wide)
------------------------------------------- */
.comments-drawer {
  position: fixed;
  top: 76px;
  right: max(20px, calc(50vw - 640px));
  width: 420px;
  max-width: 42vw;
  height: calc(100vh - 86px);
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96) translateX(-15px);
  transform-origin: left center;
  transition: opacity 0.58s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.58s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
}

.comments-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateX(0);
}

.comments-drawer-header {
  padding: 4px 12px 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 6px;
}

.comments-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comments-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #18181b;
  letter-spacing: -0.01em;
}

.btn-back-to-all {
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-back-to-all:hover {
  text-decoration: underline;
}

.close-comments-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #71717a;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.close-comments-btn:hover {
  color: #09090b;
  background-color: rgba(0, 0, 0, 0.04);
}

/* Tag Aggregate Filter Pills */
.comment-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag-filter-pill {
  font-size: 0.72rem;
  font-weight: 500;
  color: #52525b;
  background-color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(228, 228, 231, 0.8);
  border-radius: 12px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.tag-filter-pill:hover,
.tag-filter-pill.active {
  background-color: #18181b;
  color: #ffffff;
  border-color: #18181b;
}

/* -------------------------------------------
   Unified Stream Container
------------------------------------------- */
.comments-feed {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Mode 1: All Thoughts Feed --- */
.comment-card {
  position: relative;
  background: transparent;
  border: none;
  padding: 6px 8px 8px 8px;
  border-radius: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer; /* Indicates whole card is interactive */
  transition: background 0.15s ease;
}

.comment-card:hover {
  background: rgba(255, 255, 255, 0.35);
}

.comment-card.is-post-author,
.sticky-pinned-parent.is-post-author {
  background: linear-gradient(90deg, rgba(191, 240, 250, 0.35) 0%, rgba(191, 240, 250, 0.05) 100%) !important;
  border-radius: 6px;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.comment-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-nickname {
  font-size: 0.82rem;
  font-weight: 600;
  color: #18181b;
}

.comment-username {
  font-size: 0.72rem;
  color: #71717a;
}

.comment-tag-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #0369a1;
  background: rgba(154, 212, 223, 0.28);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.comment-tag-badge:hover {
  background-color: #18181b;
  color: #ffffff;
}

.comment-time {
  font-size: 0.68rem;
  color: #a1a1aa;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.comment-card:hover .comment-time,
.reply-item:hover .comment-time {
  opacity: 1;
}

.comment-body {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #27272a;
  margin-bottom: 4px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
}

.btn-agree, .btn-reply-toggle {
  background: transparent;
  border: none;
  color: #71717a;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 3px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-agree:hover {
  color: #0284c7;
}

.btn-agree.agreed {
  color: #0284c7;
  font-weight: 700;
}

.btn-reply-toggle:hover {
  color: #18181b;
}

/* -------------------------------------------
   Mode 2: Sticky Pinned Thread Anchor & Sub-Stream
------------------------------------------- */
.thread-view-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Permanently Stationed at the Top (Borderless & Minimal Padding) */
.sticky-pinned-parent {
  flex-shrink: 0;
  padding: 4px 0 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 8px;
}

.sticky-pinned-parent.is-post-author {
  background-color: rgba(154, 212, 223, 0.16);
  border-radius: 6px;
  padding: 6px 8px;
}

/* Scrollable Inner Replies Feed */
.thread-scrollable-stream {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
}

/* 1px Border Transparent Glass Tiles */
.reply-item {
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(0.1px);
  -webkit-backdrop-filter: blur(0.1px);
  max-width: 90%;
  transition: background 0.15s ease;
}

.reply-item.align-left.is-post-author {
  background: linear-gradient(90deg, rgba(203, 240, 247, 0.35) 0%, rgba(255, 255, 255, 0.05) 90%) !important;
}

.reply-item.align-right.is-post-author {
  background: linear-gradient(270deg, rgba(203, 240, 247, 0.35) 0%, rgba(255, 255, 255, 0.05) 90%) !important;
}

.reply-item:hover {
  background: rgba(255, 255, 255, 0.65);
}

.reply-item.align-left {
  align-self: flex-start;
  text-align: left;
}

.reply-item.align-right {
  align-self: flex-end;
  text-align: right;
}

.reply-item.align-right .comment-meta {
  flex-direction: row-reverse;
}

.reply-item.align-right .comment-user-info {
  flex-direction: row-reverse;
}

.reply-item.is-post-author {
  background-color: rgba(191, 240, 250, 0.22) !important;
  border-color: rgba(154, 212, 223, 0.5);
}

.reply-body {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #334155;
  margin-top: 3px;
}

/* Bold Cyan Inline Arrow Reply Trigger */
.btn-inline-reply-mention {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0284c7;
  cursor: pointer;
  padding: 0 3px;
  line-height: 1;
  opacity: 0.45;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.reply-item:hover .btn-inline-reply-mention {
  opacity: 1;
}

.btn-inline-reply-mention:hover {
  color: #0369a1;
  transform: scale(1.15);
}

/* -------------------------------------------
   Auto-Shrinking Single-Line Composer
------------------------------------------- */
.comments-composer {
  padding: 8px 12px 14px 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-textarea {
  width: 100%;
  height: 34px;
  min-height: 34px;
  max-height: 76px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  resize: none;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.comment-textarea:focus {
  border-color: #9AD4DF;
  background: #ffffff;
}

.composer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.composer-tag-select-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-select-dropdown {
  padding: 2px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
  color: #334155;
}

.custom-tag-input {
  display: none;
  padding: 2px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.72rem;
  width: 80px;
  outline: none;
  background: #ffffff;
}

/* Always Right-Aligned Action Buttons */
.btn-post-comment {
  background-color: #18181b;
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: auto; /* Guarantees strict right-alignment */
  transition: opacity 0.15s ease;
}

.btn-post-comment:hover {
  opacity: 0.9;
}

/* -------------------------------------------
   Upgraded Tree Navigation & Search
------------------------------------------- */
.sidebar-search-row {
  margin-bottom: 8px;
  position: relative;
}

.sidebar-search-input {
  width: 100%;
  padding: 6px 8px;
  background-color: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  color: #18181b;
  transition: all 0.15s ease;
}

.sidebar-search-input:focus {
  border-color: #9AD4DF;
  background-color: #ffffff;
}

/* Options Dropdown */
.options-dropdown {
  position: absolute;
  top: 46px;
  right: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: none;
  z-index: 150;
}

.options-dropdown.active {
  display: flex;
  flex-direction: column;
}

.dropdown-item {
  padding: 5px 8px;
  font-size: 0.75rem;
  color: #334155;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: #f1f5f9;
}

.sidebar-tree-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.tree-action-btn {
  background: transparent;
  border: none;
  color: #0284c7;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.tree-action-btn:hover {
  background-color: #f0f9ff;
}

.sidebar-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  user-select: none;
  font-size: 0.8rem;
  color: #64748b;
  transition: background-color 0.15s ease;
}

.folder-header:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.folder-toggle {
  font-size: 0.6rem;
  display: inline-block;
  width: 10px;
  transition: transform 0.15s ease;
}

.tree-folder:not(.open) .folder-toggle {
  transform: rotate(-90deg);
}

.tree-folder:not(.open) .folder-children {
  display: none;
}

.folder-title {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-children {
  min-height: 12px;
  position: relative;
}

.folder-children.drag-folder-into {
  background-color: rgba(154, 212, 223, 0.15);
  border-radius: 4px;
}

/* Dispatches (Max 2 lines, tight padding) */
.tree-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 5px;
  user-select: none;
  font-size: 0.8rem;
  line-height: 1.3;
  color: #334155;
  transition: background-color 0.15s ease;
}

.tree-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.tree-item.selected {
  background-color: rgba(154, 212, 223, 0.25);
  color: #0f172a;
  font-weight: 500;
  border-left: 2px solid #0284c7;
}

.tree-item.drag-over {
  border-top: 2px solid #0284c7;
}

.item-title {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: #0284c7;
  background: rgba(154, 212, 223, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 6px;
  white-space: nowrap;
}

/* Floating Context Menu */
.sidebar-context-menu {
  position: fixed;
  z-index: 1000;
  display: none;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.sidebar-context-menu.active {
  display: block;
}

.context-item {
  padding: 5px 8px;
  font-size: 0.75rem;
  color: #334155;
  border-radius: 4px;
  cursor: pointer;
}

.context-item:hover {
  background-color: #f1f5f9;
}

.context-item.danger {
  color: #ef4444;
}

.context-item.danger:hover {
  background-color: #fef2f2;
}

.context-separator {
  height: 1px;
  background-color: #f1f5f9;
  margin: 3px 0;
}

/* -------------------------------------------
   Sidebar View Panes & Transitions
------------------------------------------- */
.sidebar-view-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-view-pane.active {
  display: flex;
}

/* Blue Highlight for Options Button */
.options-btn.active {
  background-color: rgba(2, 132, 199, 0.15);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.4);
}

/* -------------------------------------------
   Settings & Filters Panel Styling
------------------------------------------- */
.settings-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.settings-scroll-container::-webkit-scrollbar {
  width: 4px;
}

.settings-scroll-container::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.settings-group:last-child {
  border-bottom: none;
}

.settings-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a1a1aa;
  margin-bottom: 2px;
}

/* Action Button */
.btn-settings-primary {
  width: 100%;
  background-color: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-settings-primary:hover {
  background-color: #e0f2fe;
  border-color: #9AD4DF;
}

/* Checkbox Rows */
.settings-checkbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
  cursor: pointer;
  user-select: none;
  padding: 5px 8px;
  border-radius: 6px;
  background-color: transparent;
  transition: all 0.15s ease;
}

.settings-checkbox-row:hover {
  background-color: #f1f5f9;
}

.settings-checkbox-row.is-active {
  background-color: rgba(154, 212, 223, 0.18);
  color: #0f172a;
  font-weight: 500;
}

.settings-checkbox-row input[type="checkbox"] {
  cursor: pointer;
  accent-color: #0284c7;
}

/* Fields & Inputs */
.settings-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #64748b;
}

.settings-input {
  width: 100%;
  padding: 5px 8px;
  font-size: 0.78rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  outline: none;
  background-color: #f8fafc;
  color: #1e293b;
  font-family: inherit;
  transition: all 0.15s ease;
}

.settings-input:focus {
  border-color: #9AD4DF;
  background-color: #ffffff;
}

.date-range-split {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-input-date {
  flex: 1;
  padding: 4px 6px;
  font-size: 0.72rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  outline: none;
  background-color: #f8fafc;
  color: #1e293b;
  font-family: inherit;
}

.settings-input-date:focus {
  border-color: #9AD4DF;
  background-color: #ffffff;
}

.date-sep {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Reset / Danger Buttons */
.reset-zone {
  margin-top: 8px;
  gap: 6px;
}

.btn-settings-reset {
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-settings-reset:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.btn-settings-reset.danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-settings-reset.danger:hover {
  background-color: #fef2f2;
  border-color: #ef4444;
}

/* -------------------------------------------
   Filter Quick Selection Pills (Top 6)
------------------------------------------- */
.filter-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.filter-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.68rem;
  color: #475569;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.filter-pill.active {
  background: rgba(154, 212, 223, 0.3);
  border-color: #9AD4DF;
  color: #0369a1;
  font-weight: 600;
}

/* -------------------------------------------
   Custom Modal (Cancel Blue / OK Grey)
------------------------------------------- */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important; /* Forces it over all drawers */
}

.custom-modal-overlay.active {
  display: flex !important;
}

.custom-modal-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  width: 320px;
  padding: 22px 20px 18px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  z-index: 100000 !important;
}

.modal-primary-text {
  font-size: 0.88rem;
  color: #1e293b;
  text-align: center;
  line-height: 1.45;
  margin-bottom: 8px;
}

.modal-warning-text {
  font-size: 1rem;
  font-weight: 700;
  color: #ef4444;
  text-align: center;
  margin-bottom: 18px;
}

.modal-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Cancel: Eye-catching Blue */
.btn-modal-cancel {
  background-color: #0284c7;
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-modal-cancel:hover {
  background-color: #0369a1;
}

/* OK: Subdued Grey */
.btn-modal-ok {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-ok:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

/* Sidebar Drag & Drop Placement Indicators */
.tree-item.drag-top,
.tree-folder.drag-top {
  border-top: 2px solid #0284c7 !important;
}

.tree-item.drag-bottom,
.tree-folder.drag-bottom {
  border-bottom: 2px solid #0284c7 !important;
}

.folder-header.drag-into {
  background-color: rgba(154, 212, 223, 0.25) !important;
}

.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

/* User Icon Button */
.btn-user-trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.btn-user-trigger:hover,
.user-menu-wrapper:hover .btn-user-trigger {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* Hover Bridge: ensures smooth transition when moving mouse from icon to card */
.user-menu-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 12px;
}

/* Floating Card Container */
.user-menu-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.14), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1000;
  box-sizing: border-box;
}

.user-menu-wrapper:hover .user-menu-card {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

/* Login Form Fields */
.user-menu-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.user-field input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s ease;
  font-family: inherit;
}

.user-field input:focus {
  border-color: #0284c7;
}

.btn-menu-primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
  margin-top: 4px;
}

.btn-menu-primary:hover {
  background: #0284c7;
}

.user-menu-error {
  font-size: 0.72rem;
  color: #ef4444;
  margin-top: 2px;
  display: none;
}

.user-menu-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 12px 0;
}

.user-menu-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.menu-link-highlight {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0284c7;
  text-decoration: none;
}

.menu-link-highlight:hover {
  text-decoration: underline;
}

.menu-link-subtle {
  font-size: 0.72rem;
  color: #64748b;
  text-decoration: none;
}

.menu-link-subtle:hover {
  color: #0f172a;
}

/* Logged In View */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-meta-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-meta-info strong {
  font-size: 0.84rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-info span {
  font-size: 0.72rem;
  color: #64748b;
}

.user-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease;
}

.user-nav-link:hover {
  background: #f8fafc;
  color: #0284c7;
}

.btn-menu-signout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ef4444;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-menu-signout:hover {
  background: #fef2f2;
}

/* --- Published Document Blocks (Callout & Quote) --- */
.block-callout {
  background-color: #f8fafc;
  border-left: 4px solid #9AD4DF !important;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 16px 0 24px 0;
}

.block-callout .callout-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1e293b;
}

.block-quote {
  border-left: 3px solid #0f172a !important;
  padding: 8px 0 8px 20px;
  margin: 16px 0 24px 0;
}

.block-quote blockquote {
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.6;
  color: #0f172a;
  quotes: none;
}

.block-media {
  margin: 20px 0 24px 0;
}

.block-media .media-caption {
  font-size: 0.82rem;
  color: #71717a;
  text-align: center;
  margin-top: 8px;
}