/* Canvas frame + markdown-mode shortcodes. Flat surfaces, no shadows. */

.canvas-root {
  --cv-bg: var(--rsites-bg, #fbfcfd);
  --cv-elevated: var(--rsites-surface, #f4f8fb);
  --cv-text: var(--rsites-fg, #14283a);
  --cv-text-2: var(--rsites-muted, #4f6778);
  --cv-text-3: var(--rsites-muted, #4f6778);
  --cv-border: var(--rsites-border, #d7e8f2);
  --cv-accent: var(--rsites-accent, #2a5f7d);
  --cv-on-accent: var(--rsites-bg, #fbfcfd);
  --cv-fill: color-mix(in srgb, var(--cv-text) 8%, transparent);
  --cv-fill-2: color-mix(in srgb, var(--cv-text) 12%, transparent);
  --cv-success: #1f8a65;
  --cv-danger: #c04848;
  --cv-warning: #c06028;
  --cv-info: #2e79b5;
  color: var(--cv-text);
  font-size: 14px;
  line-height: 20px;
}

.canvas-root,
.canvas-root * {
  box-sizing: border-box;
}

.cv-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cv-row {
  display: flex;
  flex-direction: row;
  min-width: 0;
}

.cv-grid {
  display: grid;
  min-width: 0;
}

.cv-spacer {
  flex: 1 1 auto;
}

.cv-divider {
  height: 1px;
  width: 100%;
  background: var(--cv-border);
  border: 0;
  margin: 0;
}

.canvas-root p {
  margin: 0 0 0.75rem;
}

.canvas-root .cv-grid {
  margin: 0.75rem 0 1rem;
}

.canvas-root .cv-callout,
.canvas-root .cv-card,
.canvas-root table {
  margin: 0.85rem 0 1.1rem;
}

.cv-h1 {
  margin: 0;
  font-size: 24px;
  line-height: 30px;
  font-weight: 590;
}

.cv-h2 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 590;
}

.cv-h3 {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 590;
}

.cv-text {
  margin: 0;
  color: var(--cv-text);
}

.cv-text-secondary { color: var(--cv-text-2); }
.cv-text-tertiary,
.cv-text-quaternary { color: var(--cv-text-3); }
.cv-text-small { font-size: 12px; line-height: 16px; }
.cv-text-medium { font-weight: 500; }
.cv-text-semibold { font-weight: 590; }
.cv-text-bold { font-weight: 700; }
.cv-text-italic { font-style: italic; }
.cv-text-truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cv-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--cv-fill);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.cv-link {
  color: var(--cv-accent);
}

.cv-card {
  border: 1px solid var(--cv-border);
  border-radius: 8px;
  background: var(--cv-elevated);
  overflow: hidden;
}

.cv-card-borderless {
  border: 0;
  background: transparent;
}

.cv-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 590;
  border-bottom: 1px solid var(--cv-border);
}

.cv-card-body {
  padding: 12px;
}

.cv-card-body:empty {
  display: none;
}

.cv-btn {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--cv-border);
  background: var(--cv-elevated);
  color: var(--cv-text);
  font-size: 12px;
  cursor: pointer;
}

.cv-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cv-btn-primary {
  background: var(--cv-accent);
  border-color: var(--cv-accent);
  color: var(--cv-on-accent);
}

.cv-btn-ghost {
  background: transparent;
  border-color: transparent;
}

.cv-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cv-border);
  background: transparent;
  color: var(--cv-text);
  font-size: 12px;
  cursor: pointer;
}

.cv-pill-sm {
  height: 20px;
  font-size: 11px;
  padding: 0 8px;
  border: 0;
  background: var(--cv-fill);
}

.cv-pill-active {
  background: var(--cv-fill-2);
  border-color: var(--cv-text-3);
}

.cv-stat {
  min-width: 0;
}

.cv-stat-value {
  font-size: 20px;
  line-height: 26px;
  font-weight: 590;
}

.cv-stat-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--cv-text-2);
}

.cv-stat-success .cv-stat-value { color: var(--cv-success); }
.cv-stat-danger .cv-stat-value { color: var(--cv-danger); }
.cv-stat-warning .cv-stat-value { color: var(--cv-warning); }
.cv-stat-info .cv-stat-value { color: var(--cv-info); }

.cv-callout {
  border: 1px solid var(--cv-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--cv-fill);
}

.cv-callout-title {
  margin: 0 0 4px;
  font-weight: 590;
}

.cv-callout-body {
  color: var(--cv-text-2);
}

.cv-callout-success { border-color: var(--cv-success); }
.cv-callout-danger { border-color: var(--cv-danger); }
.cv-callout-warning { border-color: var(--cv-warning); }
.cv-callout-info { border-color: var(--cv-info); }

.cv-table-wrap {
  overflow: auto;
  border: 1px solid var(--cv-border);
  border-radius: 8px;
}

.canvas-root table,
.cv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.canvas-root table th,
.canvas-root table td,
.cv-table th,
.cv-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--cv-border);
  vertical-align: top;
}

.canvas-root table th,
.cv-table th {
  font-weight: 590;
  font-size: 12px;
  color: var(--cv-text-2);
}

.canvas-root table tr:last-child td,
.cv-table tr:last-child td {
  border-bottom: 0;
}

.cv-table-striped tbody tr:nth-child(even) {
  background: var(--cv-fill);
}

.cv-tone-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  margin-right: 6px;
  background: var(--cv-text-3);
}

.cv-tone-success { background: var(--cv-success); }
.cv-tone-danger { background: var(--cv-danger); }
.cv-tone-warning { background: var(--cv-warning); }
.cv-tone-info { background: var(--cv-info); }

.cv-chart {
  width: 100%;
  overflow: auto;
}

.cv-todo {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-todo-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.cv-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.cv-usage {
  display: flex;
  height: 8px;
  width: 100%;
  overflow: hidden;
  border-radius: 99px;
  background: var(--cv-fill);
}

.cv-collapsible-head {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
