/* ============================================================
   AvidCreation chat-viewer.css
   Light theme · conversation blocks · FVW v5.2 friendly
   Reusable: drop this file into any project, point it at a JSON
   manifest, get the same chat-style prompt archive.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  background: #fafaf9;
  color: #1c1917;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ----- Header ----- */
.site-header { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid #e7e5e4; }
.site-header .header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.site-header h1 { font-size: 28px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.02em; color: #1c1917; }
.site-header .tagline { font-size: 15px; color: #57534e; margin: 0 0 10px; }
.site-header .meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: #78716c; }
.site-header .meta strong { color: #1c1917; font-weight: 600; }

.timeline-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #d6d3d1;
  color: #1c1917;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.timeline-button:hover { background: #f5f5f4; border-color: #a8a29e; }
.timeline-button.active { background: #1c1917; color: #fafaf9; border-color: #1c1917; }
.timeline-icon { font-size: 16px; }
.timeline-count {
  background: #e7e5e4;
  color: #57534e;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}
.timeline-button.active .timeline-count { background: rgba(255,255,255,0.2); color: #fafaf9; }

/* ----- Search bar (top of page, above project picker) ----- */
.search-bar-top {
  position: relative;
  margin-bottom: 18px;
}
.search-bar-top input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: 16px;
  font-family: inherit;
  background: #ffffff;
  border: 1px solid #d6d3d1;
  border-radius: 10px;
  color: #1c1917;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.search-bar-top input:focus {
  border-color: #2d4a7c;
  box-shadow: 0 0 0 3px rgba(45, 74, 124, 0.12);
}
.search-bar-top input::placeholder { color: #78716c; }
.search-bar-top::before {
  content: "🔍";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.5;
}
.search-bar-top .clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #78716c; font-size: 18px;
  cursor: pointer; padding: 4px 8px; display: none;
}
.search-bar-top.has-text .clear { display: block; }
.search-bar-top .search-hint {
  font-size: 11px;
  color: #78716c;
  margin-top: 6px;
  padding: 0 4px;
}
.search-bar-top .search-hint .search-match-count { color: #1c1917; font-weight: 600; }

.search-results-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d6d3d1;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  z-index: 40; /* below the anchor panel (z-index: 60) so the panel stays on top when both are open */
  display: none;
  max-height: 60vh;
  overflow-y: auto;
}
.search-results-panel.open { display: block; }
.search-results-panel .result-group {
  border-bottom: 1px solid #f5f5f4;
}
.search-results-panel .result-group:last-child { border-bottom: none; }
.search-results-panel .result-group-header {
  padding: 8px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #78716c;
  background: #fafaf9;
}
.search-results-panel .result-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: background 0.1s;
}
.search-results-panel .result-item:hover { background: #f5f5f4; }
.search-results-panel .result-item .result-title {
  font-size: 13px;
  color: #1c1917;
  font-weight: 500;
  line-height: 1.3;
}
.search-results-panel .result-item .result-meta {
  font-size: 11px;
  color: #78716c;
  margin-top: 2px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.search-results-panel .result-item .result-snippet {
  font-size: 12px;
  color: #57534e;
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-results-panel .result-empty {
  padding: 20px 14px;
  color: #78716c;
  font-size: 13px;
  text-align: center;
  font-style: italic;
}

.project-chips, .tag-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}
.chip-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #78716c; font-weight: 600; margin-right: 4px;
}
.chip {
  background: #ffffff;
  border: 1px solid #d6d3d1;
  color: #44403c;
  font-size: 13px; font-family: inherit;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.chip:hover { background: #f5f5f4; border-color: #a8a29e; }
.chip.active {
  background: #1c1917; color: #fafaf9; border-color: #1c1917; font-weight: 500;
}
.chip .count { margin-left: 4px; opacity: 0.6; font-size: 11px; }
.chip.active .count { opacity: 0.9; }
.chip-more { border-style: dashed; color: #57534e; font-style: italic; }
.chip-more:hover { background: #f5f5f4; border-color: #78716c; }

.search-bar { position: relative; margin-top: 8px; }
.search-bar input {
  width: 100%; padding: 10px 14px 10px 38px; font-size: 15px; font-family: inherit;
  background: #ffffff; border: 1px solid #d6d3d1; border-radius: 8px;
  color: #1c1917; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.search-bar input:focus { border-color: #2d4a7c; box-shadow: 0 0 0 3px rgba(45, 74, 124, 0.12); }
.search-bar::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: 0.5; }
.search-bar .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #78716c; font-size: 18px;
  cursor: pointer; padding: 4px 8px; display: none;
}
.search-bar.has-text .clear { display: block; }

/* ----- Main layout (conversation + anchor rail) ----- */
.main {
  position: relative;
  display: flex;
  gap: 32px;
}
.conversation-list {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ----- Conversation block ----- */
.chat-block {
  background: #ffffff;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  overflow: hidden;
  scroll-margin-top: 20px; /* for anchor rail scroll-to */
}
.chat-block .meta-strip {
  padding: 10px 16px;
  font-size: 12px;
  color: #57534e;
  background: #fafaf9;
  border-bottom: 1px solid #e7e5e4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.chat-block .meta-strip .project-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-family: inherit;
}
.project-badge.freshvibe { background: #dcfce7; color: #166534; }
.project-badge.freshcards { background: #dbeafe; color: #1e40af; }
.project-badge.smartpantry { background: #fef3c7; color: #92400e; }
.project-badge.default { background: #e7e5e4; color: #44403c; }
.chat-block .meta-strip .slug { font-weight: 600; color: #1c1917; }
.chat-block .meta-strip .timestamp { opacity: 0.7; }

.bubble-row {
  display: flex;
  margin: 14px 0;
  padding: 0 16px;
}
.bubble-row.operator { justify-content: flex-start; }
.bubble-row.mavis { justify-content: flex-end; }

.bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  word-wrap: break-word;
}
.bubble.operator {
  background: #e0e7ff; /* very light blue */
  color: #1e1b4b;
  border-bottom-left-radius: 4px;
  border: 1px solid #c7d2fe;
}
.bubble.mavis {
  background: #f5f5f4; /* neutral surface */
  color: #1c1917;
  border-bottom-right-radius: 4px;
  border: 1px solid #e7e5e4;
}
.bubble .bubble-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.7;
}
.bubble .bubble-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 6px;
  color: #1c1917;
}
.bubble .bubble-body {
  font-size: 14px;
  line-height: 1.6;
}
.bubble .bubble-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}
.bubble .bubble-toggle {
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 12px;
  font-family: inherit;
  color: #44403c;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.bubble .bubble-toggle:hover { background: rgba(255,255,255,0.9); }
.bubble .card-back { display: none; }
.bubble.expanded .card-back { display: block; }
.bubble .card-back.report-card {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.12);
  /* Report card visual style per cards.visual.report.001:
     "Smaller front region (just title + summary), larger back region" */
}

/* Sub-chips row — the switcher (no info bar, no support-acts per operator refinement) */
.bubble .rc-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.bubble .rc-sub-chip {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.12);
  color: #44403c;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s;
}
.bubble .rc-sub-chip:hover { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.2); }
.bubble .rc-sub-chip.active { background: #1c1917; color: #fafaf9; border-color: #1c1917; }

/* Sub-chip panel area (one panel per sub-chip, only one visible at a time) */
.bubble .rc-panel-area {
  max-height: 540px;
  overflow-y: auto;
  padding: 4px 2px;
}
.bubble .rc-panel {
  display: none;
  position: relative; /* for the hover-revealed copy button */
  border-radius: 6px;
  transition: box-shadow 0.15s;
}
.bubble .rc-panel.active { display: block; }
.bubble .rc-panel:hover {
  box-shadow: 0 0 0 2px rgba(45, 74, 124, 0.15);
}
.bubble .rc-panel-body { font-size: 13px; line-height: 1.6; }
.bubble .rc-panel-body p { margin: 8px 0; }
.bubble .rc-panel-body code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.bubble .rc-panel-body a { color: #2d4a7c; text-decoration: none; border-bottom: 1px dotted #2d4a7c; word-break: break-all; }
.bubble .rc-panel-body a:hover { background: #f5f5f4; border-bottom-style: solid; }
.bubble .rc-panel-body a.path-link { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.bubble .rc-panel-body pre { background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }

/* Hover-revealed copy icon (focus-mode proxy per focus-mode.zoom-not-navigate.001).
   Per operator refinement 2026-06-11 14:49: hovering a section's content area
   reveals a small "copy" icon at the top-right of that area. Click = copy
   the content for paste-into-AI (the standalone-app substitute for the live
   AI "focus" that FreshVibe Studio would provide).
   Per operator refinement 2026-06-11 14:55: the icon style matches the
   minimax document hub — a chain-link glyph inside a rounded square button
   with a subtle border. */
.bubble .rc-panel-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #ffffff;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  color: #57534e;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s, border-color 0.12s;
  z-index: 1;
  padding: 0;
}
.bubble .rc-panel:hover .rc-panel-copy { opacity: 1; }
.bubble .rc-panel-copy:hover { background: #f5f5f4; color: #1c1917; border-color: #a8a29e; }
.bubble .rc-panel-copy.copied { background: #dcfce7; color: #166534; border-color: #bbf7d0; opacity: 1; }
.bubble .rc-panel-copy svg { display: block; }

/* Front-of-bubble copy-raw button (next to view report) was removed in v24 per operator. */

/* Card front: no hover border, no padding, plain surface. */
.bubble .card-front {
  border-radius: 8px;
  transition: none;
}
.bubble .copy-btn {
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 12px;
  font-family: inherit;
  color: #44403c;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
}
.bubble .copy-btn:hover { background: rgba(255,255,255,0.9); }
.bubble .copy-btn.copied {
  background: #dcfce7; color: #166534; border-color: #bbf7d0;
}

.chat-block .tag-row {
  padding: 10px 16px 14px;
  background: #fafaf9;
  border-top: 1px solid #e7e5e4;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tag-chip {
  font-size: 11px;
  background: #ffffff;
  border: 1px solid #d6d3d1;
  color: #57534e;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  cursor: pointer;
  transition: all 0.12s;
}
.tag-chip:hover { background: #f5f5f4; border-color: #a8a29e; }
.tag-chip.active { background: #1c1917; color: #fafaf9; border-color: #1c1917; }

.status-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  font-family: inherit;
}
.status-badge.completed { background: #dcfce7; color: #166534; }
.status-badge.received { background: #e7e5e4; color: #44403c; }
.status-badge.in-progress { background: #fef3c7; color: #92400e; }
.status-badge.superseded { background: #fee2e2; color: #991b1b; }
.status-badge.unknown { background: #e7e5e4; color: #78716c; }

/* ----- Anchor rail (Notion-style, right side, always visible) ----- */
.anchor-rail {
  position: fixed;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  z-index: 90; /* below panel (100) but above search dropdown (40) */
  pointer-events: auto;
  /* Vertical timeline line running through the middle */
  background-image: linear-gradient(to bottom, transparent 0%, #e7e5e4 8%, #e7e5e4 92%, transparent 100%);
  background-size: 1px 100%;
  background-repeat: no-repeat;
  background-position: center;
  gap: 0;
}
.rail-anchor {
  width: 7px;
  height: 7px;
  background: #ffffff;
  border: 1.5px solid #a8a29e;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  margin: 3px 0;
  z-index: 1;
  padding: 0;
}
.rail-anchor:hover { border-color: #1c1917; transform: scale(1.4); }
.rail-anchor.active {
  background: #1c1917;
  border-color: #1c1917;
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(45, 74, 124, 0.15);
}
.rail-cluster {
  width: 6px;
  background: #a8a29e;
  border-radius: 3px;
  cursor: pointer;
  border: none;
  padding: 0;
  flex-shrink: 0;
  /* Height is set inline based on cluster size */
  min-height: 14px;
  margin: 2px 0;
  transition: all 0.15s;
  z-index: 1;
}
.rail-cluster:hover { background: #57534e; }
.rail-cluster.active {
  background: #1c1917;
  box-shadow: 0 0 0 3px rgba(45, 74, 124, 0.15);
}

/* ----- Hover panel (anchored to rail, fixed position) ----- */
.anchor-panel {
  position: fixed;
  top: 80px;
  right: 52px;
  width: 280px;
  max-height: 70vh;
  background: #ffffff;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 100; /* above search dropdown (z-index: 40) so panel stays on top when both are open */
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.anchor-panel.open { display: flex; }
.anchor-panel .panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid #e7e5e4;
  font-size: 12px;
  font-weight: 600;
  color: #1c1917;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.anchor-panel .panel-header .panel-count { color: #78716c; font-weight: 400; }
.anchor-panel .panel-filters {
  padding: 6px 10px;
  border-bottom: 1px solid #e7e5e4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  background: #fafaf9;
}
.anchor-panel .panel-filters .panel-filter-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #78716c;
  font-weight: 600;
  margin-right: 4px;
}
.anchor-panel .panel-filters button {
  background: #ffffff;
  border: 1px solid #d6d3d1;
  color: #57534e;
  font-size: 10px;
  font-family: inherit;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
}
.anchor-panel .panel-filters button:hover { background: #f5f5f4; }
.anchor-panel .panel-filters button.active { background: #1c1917; color: #fafaf9; border-color: #1c1917; }
.anchor-panel .panel-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.anchor-panel .day-group { display: block; }
.anchor-panel .day-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px 6px;
  background: #fafaf9;
  border: none;
  border-top: 1px solid #f5f5f4;
  border-bottom: 1px solid #e7e5e4;
  text-align: left;
  font-family: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #57534e;
  cursor: pointer;
  transition: background 0.1s;
  position: sticky;
  top: 0;
  z-index: 3;
  /* Solid background mask so prompt content scrolls behind without bleeding through */
  box-shadow: 0 1px 0 #f5f5f4;
}
.anchor-panel .day-header:hover { background: #f5f5f4; }
.anchor-panel .day-header-today {
  color: #1c1917;
  font-size: 12px;
  background: #fafaf9;
}
.anchor-panel .day-header.expanded { border-bottom-color: #e7e5e4; }
.anchor-panel .day-chevron {
  font-size: 10px;
  color: #a8a29e;
  width: 10px;
  flex-shrink: 0;
}
.anchor-panel .day-header-today .day-chevron { color: #1c1917; }
.anchor-panel .day-label { flex: 1; }
.anchor-panel .day-count {
  background: #ffffff;
  border: 1px solid #e7e5e4;
  color: #78716c;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.anchor-panel .day-header-today .day-count {
  background: #1c1917;
  color: #fafaf9;
  border-color: #1c1917;
}
.anchor-panel .day-items { display: block; }
.anchor-panel .panel-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 14px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: #1c1917;
  line-height: 1.4;
  transition: background 0.1s;
  word-wrap: break-word;
}
.anchor-panel .panel-item:hover { background: #f5f5f4; }
.anchor-panel .panel-item.active { background: #e0e7ff; }
.anchor-panel .panel-item .panel-item-time {
  display: inline-block;
  font-size: 11px;
  color: #78716c;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  margin-right: 8px;
  font-weight: 500;
  min-width: 38px;
}
.anchor-panel .panel-empty {
  padding: 20px 14px;
  color: #78716c;
  font-size: 12px;
  text-align: center;
  font-style: italic;
}
.rail-dot {
  /* legacy class — superseded by .rail-anchor (Notion-style dash) */
  display: none;
}

/* Legacy popup classes — superseded by .anchor-panel */

/* ----- Empty state ----- */
.empty-state {
  text-align: center;
  color: #78716c;
  padding: 60px 0;
  font-style: italic;
}

/* ----- Footer ----- */
.site-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid #e7e5e4;
  color: #78716c;
  font-size: 13px;
  text-align: center;
}
.site-footer a { color: #2d4a7c; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ----- Markdown rendering ----- */
.md { font-size: 14px; line-height: 1.7; color: #292524; }
.md h1, .md h2, .md h3, .md h4 { color: #1c1917; margin: 18px 0 10px; font-weight: 600; }
.md h1 { font-size: 20px; } .md h2 { font-size: 17px; }
.md h3 { font-size: 15px; } .md h4 { font-size: 14px; }
.md p { margin: 10px 0; }
.md ul, .md ol { margin: 10px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: rgba(0,0,0,0.06);
  color: #1c1917;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}
.md pre {
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 10px 0;
}
.md pre code { background: none; padding: 0; color: #292524; font-size: 12px; line-height: 1.5; }
.md blockquote {
  border-left: 3px solid #d6d3d1;
  padding-left: 12px;
  margin: 10px 0;
  color: #57534e;
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}
.md hr { border: none; border-top: 1px solid #e7e5e4; margin: 16px 0; }
.md a { color: #2d4a7c; text-decoration: none; border-bottom: 1px dotted #2d4a7c; }
.md a:hover { border-bottom-style: solid; }
.md strong { color: #1c1917; }
.md em { color: #44403c; }

/* Mobile backdrop for the panel (dims the rest of the screen when open) */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}
.panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ----- Mobile ----- */
@media (max-width: 720px) {
  .page { padding: 20px 16px 60px; }
  .site-header h1 { font-size: 22px; }
  .main { gap: 0; padding-right: 24px; /* leave room for the rail */ }
  .anchor-rail {
    /* Keep the rail visible on mobile, just smaller and tucked into the edge */
    right: 6px;
    width: 10px;
  }
  .rail-anchor { width: 5px; height: 5px; border-width: 1px; }
  .rail-cluster { width: 4px; min-height: 10px; }
  .anchor-panel {
    /* On mobile, the panel slides in from the right edge */
    right: 0;
    left: auto;
    top: 0;
    width: 85vw;
    max-width: 340px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
  }
  .anchor-panel.open { transform: translateX(0); }
  .bubble { max-width: 95%; }
  /* On mobile, the search bar takes the full width with no margin for the rail */
  .search-bar-top { padding-right: 0; }
}

button:focus-visible, input:focus-visible, .chip:focus-visible,
.tag-chip:focus-visible, .rail-dot:focus-visible, .anchor-item:focus-visible {
  outline: 2px solid #2d4a7c; outline-offset: 2px;
}
html { scroll-behavior: smooth; }
