/* Phase D — consolidated AI Summary / Transcript source picker.
   One AI Summary tab + one Transcript tab; when a note has BOTH a Granola
   and a Zoom source for a surface, a small "Source" row with a dropdown
   appears at the top of that panel (#ai-src-row / #tr-src-row, wired in
   static/app.js). The .src-zoom class on the panel swaps the Granola
   rendering for the inline read-only Zoom view. Kept out of style.css on
   purpose; uses the app's existing CSS variables. */

.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.src-row-label {
  font-size: 12px;
  color: var(--text-muted);
}

.src-row-sel {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
}

.src-row-sel:focus {
  outline: none;
  border-color: var(--accent);
}

/* Inline Zoom views — hidden until the panel enters .src-zoom mode. */
.src-zoom-view {
  display: none;
}

.src-zoom-meta {
  font-size: 12px;
  margin-bottom: 8px;
}

#tab-ai-summary.src-zoom .src-zoom-view,
#tab-transcript.src-zoom .src-zoom-view {
  display: block;
}

/* Zoom selected on AI Summary: hide the Granola (trix) editor.
   #ai-summary-editor covers the pre-init <textarea> too. */
#tab-ai-summary.src-zoom trix-toolbar,
#tab-ai-summary.src-zoom trix-editor,
#tab-ai-summary.src-zoom #ai-summary-editor {
  display: none;
}

/* Zoom selected on Transcript: hide the Granola toolbar + content.
   !important beats the toolbar's inline style="display:flex". */
#tab-transcript.src-zoom #transcript-toolbar {
  display: none !important;
}

#tab-transcript.src-zoom #transcript-zoom-dropzone {
  display: none;
}

/* "Writing notes" card — Granola's own post-meeting confirmation, mirrored
   here. setupSummaryEditor() (app.js) puts #tab-ai-summary into
   .ai-summary-empty and un-hides #ai-summary-writing whenever the AI summary
   is blank; both flip back the moment content arrives. Same card also stays
   hidden under .src-zoom (a Zoom summary is already on screen, so there's
   nothing "being written"). */
#tab-ai-summary.ai-summary-empty trix-toolbar,
#tab-ai-summary.ai-summary-empty trix-editor,
#tab-ai-summary.ai-summary-empty #ai-summary-editor {
  display: none;
}

.ai-summary-writing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
}

#tab-ai-summary.src-zoom .ai-summary-writing {
  display: none !important;
}

.ai-summary-writing-spinner {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: rg-spin 0.9s linear infinite;
}

.ai-summary-writing-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
}

/* ── Upcoming view: reminders & blocks ──────────────────────────────
   Calendar events classified is_meeting:false (solo recurring reminders,
   work blocks, delivery windows, all-day banners) collapse into a muted
   <details class="upc-reminders"> group at the end of each day
   (static/app.js loadUpcoming). Real meetings render as before. */

.upc-reminders {
  margin: 2px 0 4px;
}

.upc-reminders > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
  list-style: none;
  user-select: none;
}

.upc-reminders > summary::-webkit-details-marker {
  display: none;
}

.upc-reminders > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  transition: transform 0.15s ease;
}

.upc-reminders[open] > summary::before {
  transform: rotate(90deg);
}

.upc-reminders > summary:hover {
  color: var(--text);
}

/* Inner rows: same layout as regular upcoming events, visually muted. */
.upc-reminders .upcoming-event {
  opacity: 0.55;
}

.upc-reminders .upcoming-event:hover {
  opacity: 0.85;
}

/* Home's "Coming up" feed reuses this same group, but its rows are
   .meeting-row (static/app.js renderUpcomingEvents), not .upcoming-event —
   the two screens render the same events with different card markup. Muted
   the same way so a block never reads as heavily as a real meeting. */
.upc-reminders .meeting-row {
  opacity: 0.6;
  background: transparent;
}

.upc-reminders .meeting-row:hover {
  opacity: 0.9;
}

.upc-reminders .meeting-row-title {
  font-weight: 500;
  color: var(--text-muted);
}


/* Staged progress for the post-recording wait (2026-08-06).
   Brian: "I find myself refreshing blindly just to see if it's capturing the
   transcript or AI summary." A single spinner cannot distinguish "working" from
   "stuck", so the card now names which stage it is in and ticks each one off as
   the poll sees it land. Movement on screen is the whole point. */
.ai-summary-writing-body { display: flex; flex-direction: column; gap: 6px; }
.ai-summary-writing-steps { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.asw-step { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.asw-step::before { content: "○"; font-size: 11px; }
.asw-step.done { color: var(--fg); }
.asw-step.done::before { content: "●"; color: var(--dm-ok-text); }
.asw-step.active { color: var(--fg); font-weight: 600; }
.asw-step.active::before { content: "◍"; color: var(--dm-warn-text); }
.ai-summary-writing-elapsed { font-size: 11px; color: var(--muted); }
.ai-summary-done-flash { animation: aswFlash 1.4s ease-out 1; }
@keyframes aswFlash {
  0%   { background: #d6e7d6; }
  100% { background: transparent; }
}

/* Double-click-to-edit: AI Summary + Transcript (static/app.js's
   enterSectionEdit/exitSectionEdit). Hidden by default on both panels —
   only a double-click of the panel content (never the Zoom view, never the
   source picker) reveals the bar for that one panel. This is the ONLY
   visible sign editing is available; there is deliberately no hint before
   the double-click, matching the panels' otherwise-unchanged read-only look. */
.section-edit-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--accent-soft, #eef4fb);
  border: 1px solid var(--accent, #0a66c2);
  border-radius: 6px;
}

.section-edit-hint {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

/* Transcript's editor is a separate mount (#transcript-editor -> Trix) from
   its read-only view (#transcript-content) — AI Summary reuses one Trix
   element for both, toggling contenteditable, so it needs no such wrapper. */
#transcript-edit-wrap .trix-content {
  min-height: 200px;
}
