/* ---------------------------------------------------------------------
 * MarkdownEditor organism — Quill 2 (bubble theme) → markdown.
 * Toolbar floats on selection (Medium/Notion style). Identyczny stack
 * co `.composer-editor-wrap` w chacie, ale lżejszy (bez mentions/upload).
 * ------------------------------------------------------------------ */

.md-editor {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  overflow: visible;
}

.md-editor-quill-wrap {
  position: relative;
  overflow: visible;
}

.md-editor-quill-editor {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

/* Quill bubble theme: kontener wewnętrzny; nadpisujemy minimalnie żeby
   placeholder / padding pasowały do reszty UI sembota. Bubble toolbar
   sam stamponuje pozycję via Quill. */
.md-editor-quill .ql-editor {
  padding: 10px 12px;
  min-height: inherit;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
.md-editor-quill .ql-editor.ql-blank::before {
  color: var(--ink-5);
  font-style: normal;
  left: 12px;
  right: 12px;
}
.md-editor-quill .ql-editor p,
.md-editor-quill .ql-editor h1,
.md-editor-quill .ql-editor h2,
.md-editor-quill .ql-editor h3,
.md-editor-quill .ql-editor ul,
.md-editor-quill .ql-editor ol,
.md-editor-quill .ql-editor blockquote {
  margin: 0 0 4px;
}

/* ---------------------------------------------------------------------
 * .md-rendered — common style for both preview pane and timeline
 * activity body. Mirrors GitHub-comment vibe: paragraph rhythm, code
 * mono, list indentation, link color, blockquote bar.
 * ------------------------------------------------------------------ */

.md-rendered { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.md-rendered > *:first-child { margin-top: 0; }
.md-rendered > *:last-child { margin-bottom: 0; }
.md-rendered p { margin: 0 0 8px; }
.md-rendered h1, .md-rendered h2, .md-rendered h3, .md-rendered h4 {
  margin: 12px 0 6px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.md-rendered h1 { font-size: 17px; }
.md-rendered h2 { font-size: 15px; }
.md-rendered h3 { font-size: 14px; }
.md-rendered h4 { font-size: 13px; }
.md-rendered ul, .md-rendered ol { padding-left: 22px; margin: 0 0 8px; }
.md-rendered li { margin: 2px 0; }
.md-rendered a {
  color: var(--accent, #3b6bf6);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent, #3b6bf6) 30%, transparent);
}
.md-rendered a:hover { border-bottom-color: var(--accent, #3b6bf6); }
.md-rendered code {
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SF Mono, Menlo, Consolas, monospace;
  font-size: 12px;
}
.md-rendered pre {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.45;
}
.md-rendered pre code { background: transparent; padding: 0; }
.md-rendered blockquote {
  border-left: 3px solid var(--line);
  padding: 2px 0 2px 10px;
  margin: 8px 0;
  color: var(--ink-3);
}
.md-rendered hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.md-rendered img { max-width: 100%; height: auto; border-radius: 4px; }
.md-rendered table {
  border-collapse: collapse;
  margin: 8px 0;
}
.md-rendered th, .md-rendered td {
  border: 1px solid var(--line);
  padding: 4px 8px;
  text-align: left;
}
.md-rendered th { background: var(--bg-elev); font-weight: 600; }

/* ---------------------------------------------------------------------
 * Activity composer rows (lead detail page). Shared with similar forms.
 * ------------------------------------------------------------------ */

.composer-form { display: flex; flex-direction: column; gap: 8px; }

.composer-row { display: flex; flex-direction: column; gap: 4px; }
.composer-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.composer-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  font-weight: 500;
}

.composer-empty-hint {
  font-size: 12px;
  color: var(--ink-3);
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.composer-tab[data-active="true"] {
  background: var(--bg) !important;
  border-color: var(--accent, #3b6bf6) !important;
  color: var(--ink) !important;
  font-weight: 500;
}

/* Activity row meta (scheduled date, location, link, target contact). */
.activity-row[data-kind^="call"] .activity-kind,
.activity-row[data-kind^="meeting"] .activity-kind { color: var(--accent, #3b6bf6); }
.activity-row[data-kind^="send"] .activity-kind { color: #b06d00; }
.activity-row[data-kind="note"] .activity-kind { color: var(--ink-3); }
.activity-meta a { text-decoration: none; }
.activity-meta a:hover { text-decoration: underline; }
