/*
 * The docs site's whole stylesheet (#1437), the files site's with a
 * library's two columns - its navigation and the article - added at the end.
 *
 * No framework and no script, the issuer's choices and for its reason: this is
 * a handful of pages that render what other people wrote, and a strict
 * Content-Security-Policy is worth more here than a component library. The
 * --cbm-* names are the platform's own tokens, restated rather than imported.
 */
:root {
  --cbm-accent: #6366f1;
  --cbm-accent-strong: #4f46e5;
  --cbm-ink: #0f172a;
  --cbm-ink-soft: #475569;
  --cbm-surface: #ffffff;
  --cbm-body-bg: #eef0ff;
  --cbm-header-bg: #0f172a;
  --cbm-header-ink: #e2e8f0;
  --cbm-line: #cbd5e1;
  --cbm-error: #b91c1c;
  --cbm-error-bg: #fef2f2;
  --cbm-waiting: #92400e;
  --cbm-waiting-bg: #fef3c7;
  --cbm-done: #166534;
  --cbm-done-bg: #dcfce7;
  --cbm-agent-bg: #eef2ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cbm-ink: #e2e8f0;
    --cbm-ink-soft: #94a3b8;
    --cbm-surface: #1e293b;
    --cbm-body-bg: #0f172a;
    --cbm-header-bg: #020617;
    --cbm-line: #334155;
    --cbm-error: #fca5a5;
    --cbm-error-bg: #3f1d1d;
    --cbm-waiting: #fcd34d;
    --cbm-waiting-bg: #422006;
    --cbm-done: #86efac;
    --cbm-done-bg: #052e16;
    --cbm-agent-bg: #1e1b4b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cbm-body-bg);
  color: var(--cbm-ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.cbm-header { background: var(--cbm-header-bg); color: var(--cbm-header-ink); }
.cbm-header-inner {
  max-width: 56rem; margin: 0 auto; padding: 14px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
}
.cbm-brand { color: inherit; text-decoration: none; display: flex; gap: 8px; align-items: baseline; }
.cbm-brand-tenant { font-weight: 700; font-size: 1.1rem; }
.cbm-brand-site { color: #a5b4fc; }
.cbm-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.cbm-nav a, .cbm-link-button { color: inherit; text-decoration: none; }
.cbm-nav a:hover, .cbm-link-button:hover { text-decoration: underline; }
.cbm-inline { display: inline; margin: 0; }
.cbm-link-button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

.cbm-main { max-width: 56rem; margin: 0 auto; padding: 24px 16px 48px; }

.cbm-card {
  background: var(--cbm-surface);
  border: 1px solid var(--cbm-line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.cbm-card h1 { margin: 0 0 12px; font-size: 1.4rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.cbm-card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.cbm-muted { color: var(--cbm-ink-soft); font-size: 0.925rem; }
.cbm-reference { margin: 0 0 4px; color: var(--cbm-ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.cbm-alert, .cbm-notice { padding: 12px 14px; border-radius: 8px; margin: 0 0 20px; background: var(--cbm-agent-bg); }
.cbm-alert-danger, .cbm-alert-warning { background: var(--cbm-error-bg); color: var(--cbm-error); }

.cbm-status {
  display: inline-block; margin: 0; padding: 2px 10px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; background: var(--cbm-agent-bg); white-space: nowrap;
}
.cbm-status-waiting_on_customer { background: var(--cbm-waiting-bg); color: var(--cbm-waiting); }
.cbm-status-resolved, .cbm-status-closed { background: var(--cbm-done-bg); color: var(--cbm-done); }

.cbm-list { list-style: none; margin: 0; padding: 0; }
.cbm-list li { border-top: 1px solid var(--cbm-line); }
.cbm-list li:first-child { border-top: 0; }
.cbm-row {
  display: grid; grid-template-columns: 7rem 1fr auto; gap: 4px 16px; align-items: center;
  padding: 12px 4px; color: inherit; text-decoration: none;
}
.cbm-row:hover .cbm-row-subject { text-decoration: underline; }
.cbm-row-subject { overflow-wrap: anywhere; }
@media (max-width: 36rem) {
  .cbm-row { grid-template-columns: 1fr auto; }
  .cbm-row .cbm-reference { grid-column: 1 / -1; }
}

.cbm-message { border: 1px solid var(--cbm-line); border-radius: 10px; padding: 14px 16px; margin: 0 0 12px; }
.cbm-message-agent { background: var(--cbm-agent-bg); }
.cbm-message-meta { margin: 0 0 6px; color: var(--cbm-ink-soft); font-size: 0.875rem; }
.cbm-message-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cbm-attachments { margin: 8px 0 0; padding-left: 18px; font-size: 0.925rem; }

.cbm-field { margin-bottom: 16px; }
.cbm-field label { display: block; margin-bottom: 6px; font-size: 0.925rem; font-weight: 600; }
.cbm-field input[type="text"], .cbm-field textarea, .cbm-field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--cbm-line); border-radius: 8px;
  background: var(--cbm-surface); color: inherit; font: inherit;
}
.cbm-field textarea { min-height: 10rem; resize: vertical; }
.cbm-field input:focus-visible, .cbm-field textarea:focus-visible, .cbm-field select:focus-visible {
  outline: 2px solid var(--cbm-accent); outline-offset: 1px;
}
.cbm-field-error { color: var(--cbm-error); font-size: 0.875rem; margin: 4px 0 0; }
.cbm-choice { display: block; margin: 4px 0; font-weight: 400; }

.cbm-button {
  display: inline-block; padding: 10px 18px; border: 0; border-radius: 8px;
  background: var(--cbm-accent); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.cbm-button:hover { background: var(--cbm-accent-strong); }
.cbm-button-secondary { background: transparent; color: var(--cbm-accent); border: 1px solid var(--cbm-line); }
.cbm-button-secondary:hover { background: var(--cbm-body-bg); }
.cbm-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cbm-heading-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cbm-heading-row h1 { margin: 0; }
.cbm-resolve { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--cbm-line); }
fieldset.cbm-field { border: 0; padding: 0; margin: 0 0 16px; }
fieldset.cbm-field legend { font-size: 0.925rem; font-weight: 600; margin-bottom: 6px; padding: 0; }

.cbm-list { list-style: none; margin: 0; padding: 0; }
.cbm-list-item { padding: 0.5rem 0; border-bottom: 1px solid #e5e7eb; }
.cbm-kind { font-size: 0.85em; color: #64748b; }

/* A library: navigation beside the article, stacked on a narrow screen. */
.cbm-library { display: grid; grid-template-columns: minmax(12rem, 16rem) 1fr; gap: 20px; align-items: start; }
@media (max-width: 720px) { .cbm-library { grid-template-columns: 1fr; } }
.cbm-tree, .cbm-tree ul { list-style: none; margin: 0; padding: 0; }
.cbm-tree ul { padding-left: 14px; border-left: 1px solid var(--cbm-line); margin: 4px 0 4px 6px; }
.cbm-tree li { margin: 4px 0; }
.cbm-tree a { color: var(--cbm-ink); text-decoration: none; overflow-wrap: anywhere; }
.cbm-tree a:hover { text-decoration: underline; }
.cbm-tree a[aria-current="page"] { color: var(--cbm-accent-strong); font-weight: 600; }
.cbm-language {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px;
  font-size: 0.75rem; text-transform: uppercase;
  background: var(--cbm-waiting-bg); color: var(--cbm-waiting);
}
.cbm-article { overflow-wrap: anywhere; }
.cbm-article img { max-width: 100%; height: auto; }
.cbm-article pre, .cbm-article code { white-space: pre-wrap; }
.cbm-translations { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
