/* clinicalcorpus.com chat widget — pairs with clinicalcorpus-chat-widget.js.
   Minimal on purpose: real visual design should follow the Kadence theme's
   own tokens once this is wired into a real page, not invent a second
   design language here. */

.ccc-chat {
  max-width: 720px;
  margin: 0 auto;
  font-size: 15px;
}

.ccc-history {
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 16px;
}

.ccc-turn {
  border-bottom: 1px solid var(--ccc-border, #e2e8f0);
  padding: 16px 0;
}

.ccc-q {
  font-weight: 600;
  margin-bottom: 8px;
}

.ccc-a {
  line-height: 1.6;
}

/* 2026-09-18: real spacing for lists — previously bullet/numbered lines
   were joined with plain <br>, so items ran together with no gap. p/ul/ol
   here are the actual block elements _formatAnswer now emits. */
.ccc-a p {
  margin: 0 0 14px;
}
.ccc-a p:last-child {
  margin-bottom: 0;
}
.ccc-a ul,
.ccc-a ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
.ccc-a ul:last-child,
.ccc-a ol:last-child {
  margin-bottom: 0;
}
.ccc-a li {
  margin-bottom: 10px;
  line-height: 1.6;
}
.ccc-a li:last-child {
  margin-bottom: 0;
}
.ccc-a strong {
  font-weight: 600;
}

.ccc-loading {
  color: var(--ccc-text-muted, #64748b);
  font-style: italic;
}

.ccc-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px;
  margin: 12px 0;
}

.ccc-cite a {
  text-decoration: none;
  color: var(--ccc-accent, #185fa5);
}

.ccc-sources {
  margin-top: 12px;
  padding-left: 20px;
  font-size: 13px;
  color: #475569;
}

.ccc-controls {
  border-top: 1px solid var(--ccc-border, #e2e8f0);
  padding-top: 12px;
}

.ccc-expand {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ccc-accent, #185fa5);
  cursor: pointer;
}

.ccc-expand:hover {
  text-decoration: underline;
}

.ccc-form {
  display: flex;
  gap: 8px;
}

.ccc-form textarea {
  --ccc-textarea-max: 200px; /* read by _autoGrow() in the JS — keep the two in sync if this changes */
  flex: 1;
  resize: none; /* auto-grow (see JS) manages height instead of a manual drag handle */
  max-height: var(--ccc-textarea-max);
  overflow-y: auto; /* scrolls internally once the cap is hit, instead of growing forever */
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
}

.ccc-form button {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  background: var(--ccc-btn-bg, #185fa5);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.ccc-form button:hover {
  background: #0c447c;
}

/* 2026-09-12: notes (non-question / declined / no-answer / scope refusal), restriction notices,
   source metadata and the low-quota hint. Colors follow the existing palette. */
.ccc-a-note {
  color: #475569;
  font-style: italic;
}

.ccc-notice {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ccc-text-muted, #64748b);
  border-left: 3px solid #cbd5e1;
  padding-left: 8px;
}

.ccc-src-meta {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

.ccc-sources a {
  color: var(--ccc-accent, #185fa5);
  text-decoration: none;
}

.ccc-sources a:hover {
  text-decoration: underline;
}

.ccc-quota {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
}

.ccc-sources-label {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ccc-quota-warn {
  color: #b45309;
  font-weight: 600;
}

/* 2026-09-18: per-answer print/save-as-PDF button + its print sheet. */
.ccc-turn-actions {
  margin-top: 10px;
  display: flex;
}

.ccc-print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: #94a3b8;
  cursor: pointer;
}

.ccc-print-btn:hover {
  color: var(--ccc-accent, #185fa5);
  background: #f1f5f9;
}

.ccc-print-btn svg {
  display: block;
}

/* Hidden on screen; only shown for the one turn being printed (see
   _buildPrintSheet in the JS) and only rendered at all under print. */
#ccc-print-sheet {
  display: none;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #ccc-print-sheet,
  #ccc-print-sheet * {
    visibility: visible !important;
  }
  #ccc-print-sheet {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  /* Left-margin source rail, vertical, non-intrusive — same convention as
     the strip arXiv prints on the left edge of every paper's PDF.
     position:fixed repeats it on every printed page in Chrome/Chromium,
     which is what "Save as PDF" uses. */
  .ccc-print-rail {
    position: fixed;
    left: 6mm;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 10.2px; /* +20% from 8.5px, owner request 2026-09-18 */
    letter-spacing: 0.05em;
    color: #9aa3ad;
    font-family: Arial, Helvetica, sans-serif;
  }
  .ccc-print-body {
    margin-left: 20mm;
    margin-right: 12mm;
    padding-top: 8mm;
    padding-bottom: 14mm;
    font-family: Arial, Helvetica, sans-serif;
    color: #1e1e1e;
  }
  .ccc-print-q {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
  }
  .ccc-print-a {
    font-size: 12px;
    line-height: 1.6;
  }
  .ccc-print-a p {
    margin: 0 0 10px;
  }
  .ccc-print-a ul,
  .ccc-print-a ol {
    margin: 0 0 10px;
    padding-left: 18px;
  }
  .ccc-print-a li {
    margin-bottom: 6px;
  }
  .ccc-print-a strong {
    font-weight: 700;
  }
  .ccc-print-a sup a,
  .ccc-print-sources a {
    color: #185fa5;
    text-decoration: none;
  }
  .ccc-print-sources-label {
    margin-top: 18px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
  }
  .ccc-print-sources {
    margin-top: 8px;
    padding-left: 16px;
    font-size: 10.5px;
    color: #334155;
  }
  .ccc-print-sources li {
    margin-bottom: 10px;
  }
  .ccc-print-src-meta {
    color: #64748b;
    font-size: 9.5px;
  }
  .ccc-print-src-url {
    color: #94a3b8;
    font-size: 8.5px;
    word-break: break-all;
  }
  /* User email, tiny, bottom of every page — repeats per page for the
     same reason as the rail (position:fixed under Chrome's print engine). */
  .ccc-print-footer {
    position: fixed;
    bottom: 6mm;
    left: 20mm;
    right: 12mm;
    text-align: center;
    font-size: 7.5px;
    color: #b6bcc4;
    font-family: Arial, Helvetica, sans-serif;
  }
}

/* 2026-09-21: bibliography mode (numbered reference list + copy button). */
.ccc-bib-head {
  font-weight: 600;
}

.ccc-bib {
  margin: 8px 0 0;
  padding-left: 28px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #334155;
}

.ccc-bib li {
  margin-bottom: 7px;
  padding-left: 4px;
}

.ccc-bib-link {
  color: var(--ccc-accent, #185fa5);
  text-decoration: none;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 5px;
  margin-left: 4px;
  white-space: nowrap;
}

.ccc-bib-link:hover {
  background: #f1f5f9;
}

.ccc-bib-foot {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ccc-text-muted, #64748b);
}

.ccc-copy {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ccc-accent, #185fa5);
  cursor: pointer;
}

.ccc-copy:hover {
  text-decoration: underline;
}

@media print {
  .ccc-print-bib {
    margin: 8px 0 0;
    padding-left: 24px;
    font-size: 10.5pt;
    line-height: 1.45;
  }
  .ccc-print-bib li {
    margin-bottom: 6pt;
    page-break-inside: avoid;
  }
  #ccc-print-sheet .ccc-bib-foot {
    margin-top: 10pt;
    font-size: 9pt;
    color: #64748b;
  }
}

/* v1.17 (2026-09-27) -- sign-up / log-in panel shown to visitors (and to members
   without a search plan) instead of an error. Colors come from the site tokens
   (Additional CSS); the fallbacks are the light-mode values. */
.ccc-chat .ccc-gate-box {
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px solid var(--ccc-border, #e2e8f0);
  border-left: 4px solid var(--ccc-btn-bg, #1656a3);
  border-radius: 10px;
  background: var(--ccc-card-bg, #ffffff);
  color: var(--ccc-text, #212121);
}
.ccc-chat .ccc-gate-box p {
  margin: 0 0 12px;
  line-height: 1.5;
}
.ccc-chat .ccc-gate-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}
.ccc-chat .ccc-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ccc-chat .ccc-gate-actions a {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
}
.ccc-chat .ccc-gate-primary {
  background: var(--ccc-btn-bg, #1656a3);
  color: #ffffff !important;
}
.ccc-chat .ccc-gate-primary:hover {
  background: var(--ccc-btn-bg-hover, #0f3f7a);
}
.ccc-chat .ccc-gate-secondary {
  border: 1px solid var(--ccc-border, #e2e8f0);
  color: var(--ccc-accent, #1656a3) !important;
}
.ccc-chat .ccc-gate-secondary:hover {
  border-color: var(--ccc-accent, #1656a3);
}

/* v1.18 (2026-09-27) -- "N free searches left" line under a visitor's answer. */
.ccc-chat .ccc-anon-left {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ccc-text-muted, #5b6472);
}
.ccc-chat .ccc-anon-left a {
  color: var(--ccc-accent, #1656a3);
  font-weight: 600;
}
