/* ==========================================================================
   MeowMD converter pages (convert.css): markdown-to-pdf, markdown-to-html, readme-preview
   Built on tools.css; adds the URL box, drop hint, preview pane and print rules.
   ========================================================================== */

.cv-bar .cv-file-btn { cursor: pointer; }
.cv-chip {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.6rem;
}

.cv-url {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.cv-url-input {
  flex: 1;
  min-width: 220px;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.7rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.cv-url-input:focus { outline: none; border-color: var(--border-focus); }
.cv-url .btn { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.cv-url-error { flex-basis: 100%; margin: 0; font-size: 0.8rem; color: var(--danger); }

.cv-drop {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border-light);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.cv-drop.is-over, body.cv-dragging .cv-drop { background: var(--primary-subtle); color: var(--text-main); }

.cv-status { font-weight: 400; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-text { flex: 1; min-height: 420px; }

.cv-preview-wrap { flex: 1; overflow: auto; padding: 1.25rem 1.5rem; min-height: 420px; max-height: 70vh; background: var(--bg-surface); }
.cv-preview-wrap[hidden], .cv-htmlout[hidden] { display: none; }
.cv-preview { max-width: none; }
.cv-preview:empty::before { content: 'The rendered result appears here.'; color: var(--text-light); font-size: 0.9rem; }
.cv-htmlout { flex: 1; min-height: 420px; font-family: var(--font-mono); font-size: 0.78rem; }

.cv-tabs { display: flex; gap: 0.15rem; }
.cv-view-tab {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.cv-view-tab:hover { background: var(--bg-hover); }
.cv-view-tab.active { color: var(--text-main); background: var(--bg-surface-subtle); }

.cv-actions { border-top: 1px solid var(--border-light); border-bottom: 0; }

/* Keep blocks together when html2pdf / print cuts pages */
.cv-preview pre, .cv-preview table, .cv-preview img, .cv-preview .mermaid-wrapper, .cv-preview .chart-wrapper,
.cv-preview blockquote, .cv-preview .markdown-alert { break-inside: avoid; page-break-inside: avoid; }
.cv-preview h1, .cv-preview h2, .cv-preview h3 { break-after: avoid; page-break-after: avoid; }

@media (max-width: 860px) {
  .cv-grid { grid-template-columns: 1fr; }
  .cv-grid .tool-pane + .tool-pane { border-left: 0; border-top: 1px solid var(--border-light); }
  .cv-text, .cv-preview-wrap, .cv-htmlout { min-height: 260px; max-height: none; }
  .cv-preview-wrap { padding: 1rem; }
}

@media print {
  body > header, .tool-hero, .tool-section, .site-footer, .cv-bar, .cv-url, .cv-drop, .cv-actions,
  .cv-grid > .tool-pane:first-child, .tool-pane-head, .toast-container, .skip-link, .cv-htmlout, .code-copy-btn { display: none !important; }
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }
  .tool-page { padding: 0; max-width: none; }
  .tool-card { border: 0; border-radius: 0; overflow: visible; }
  .tool-grid { display: block; min-height: 0; }
  .tool-pane + .tool-pane { border: 0; }
  .cv-preview-wrap { overflow: visible; max-height: none; padding: 0; min-height: 0; }
}
