/* ClearGlass CLEARMINE — page shell.
 *
 * The workspace bundle ships its own Tailwind preflight, which zeroes borders
 * and margins on every element in the document. Everything here is therefore
 * declared explicitly rather than relying on a UA default, and the shell keeps
 * to its own `cm-` namespace so no rule reaches into the workspace tree.
 *
 * The workspace mounts fixed-position chrome (a rail, a status bar, modals)
 * anchored to the viewport. `.cm-workspace` takes `contain: layout paint`,
 * which makes it the containing block for those descendants — the app frames
 * itself inside the page instead of floating over the rest of it.
 *
 * Palette note: this shell reads cyan (#00f0ff) where the ORELOGIC shell reads
 * amber, so the two mineral surfaces stay visually distinct and the shell
 * matches the accent the CLEARMINE workspace paints itself in.
 */

.cm-page {
  margin: 0;
  background: #08090c;
  color: #e6edf3;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.cm-page a { color: inherit; }

.cm-mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cm-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: #00f0ff;
  color: #08090c;
  font-weight: 700;
  border-radius: 0 0 10px 0;
  text-decoration: none;
}
.cm-skip:focus { left: 0; }

/* ── top bar ─────────────────────────────────────────────────────────────── */

.cm-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 34px);
  background: #0d1117;
  border-bottom: 1px solid #21262d;
}

.cm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #e6edf3;
}

.cm-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #00f0ff, #0284a8);
  color: #08090c;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .04em;
}

.cm-brand strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.cm-brand small { display: block; font-size: 10px; letter-spacing: .22em; color: #8b949e; text-transform: uppercase; }

.cm-crumb {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8b949e;
}
.cm-crumb a { color: #38e8ff; text-decoration: none; }
.cm-crumb a:hover, .cm-crumb a:focus-visible { color: #fff; text-decoration: underline; }

.cm-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #30363d;
  background: #161b22;
  color: #c9d1d9;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  text-decoration: none;
}
.cm-chip--cyan { border-color: rgba(0, 240, 255, .5); color: #5ef2ff; }

.cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #30363d;
  background: #161b22;
  color: #e6edf3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.cm-btn:hover:not(:disabled), .cm-btn:focus-visible:not(:disabled) { border-color: #00f0ff; color: #fff; }
.cm-btn:disabled { opacity: .45; cursor: not-allowed; }
.cm-btn--primary { background: #00f0ff; border-color: #00f0ff; color: #08090c; }
.cm-btn--primary:hover, .cm-btn--primary:focus-visible { background: #5ef2ff; color: #08090c; }

/* ── provenance banner ───────────────────────────────────────────────────── */

.cm-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 34px);
  background: rgba(0, 240, 255, .09);
  border-bottom: 1px solid rgba(0, 240, 255, .3);
  color: #bfeeff;
  font-size: 13px;
  line-height: 1.6;
}
.cm-banner strong { color: #5ef2ff; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }
.cm-banner p { margin: 0; }

/* ── workspace frame ─────────────────────────────────────────────────────── */

.cm-workspace {
  position: relative;
  contain: layout paint;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  max-height: 1400px;
  overflow: auto;
  background: #111417;
  border-bottom: 1px solid #21262d;
}

.cm-noscript {
  padding: 40px clamp(16px, 4vw, 34px);
  background: #0d1117;
  color: #c9d1d9;
  line-height: 1.7;
}

/* ── content sections ────────────────────────────────────────────────────── */

.cm-section { padding: clamp(48px, 7vw, 92px) clamp(16px, 4vw, 34px); border-bottom: 1px solid #16191f; }
.cm-inner { width: min(1180px, 100%); margin: 0 auto; }

.cm-eyebrow {
  margin: 0 0 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #38e8ff;
}

.cm-section h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: #f4f7fb;
}
.cm-section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.015em;
  color: #f4f7fb;
}
.cm-section h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; color: #f4f7fb; }
.cm-section p { margin: 0 0 16px; color: #a7b1bd; line-height: 1.75; max-width: 78ch; }
.cm-section p:last-child { margin-bottom: 0; }
.cm-section strong { color: #e6edf3; }

.cm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.cm-card {
  padding: 22px;
  border-radius: 14px;
  border: 1px solid #21262d;
  background: #0d1117;
}
.cm-card p { font-size: 14px; margin: 0; color: #8b949e; }
.cm-card-tag {
  display: block;
  margin-bottom: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #38e8ff;
}

.cm-list { margin: 0; padding: 0 0 0 20px; color: #a7b1bd; line-height: 1.8; }
.cm-list li { margin-bottom: 8px; }

.cm-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* ── custody console ─────────────────────────────────────────────────────── */

.cm-console {
  margin-top: 30px;
  border: 1px solid #21262d;
  border-radius: 14px;
  background: #0d1117;
  overflow: hidden;
}

.cm-console-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-bottom: 1px solid #21262d;
}
.cm-console-stat { padding: 18px 20px; border-right: 1px solid #21262d; }
.cm-console-stat:last-child { border-right: 0; }
.cm-console-stat span {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #6e7781;
  margin-bottom: 6px;
}
.cm-console-stat b {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 700;
  color: #5ef2ff;
  overflow-wrap: anywhere;
}

.cm-console-bar { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid #21262d; }

.cm-console-status {
  padding: 14px 20px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #8b949e;
  border-bottom: 1px solid #21262d;
  overflow-wrap: anywhere;
}
.cm-console-status[data-kind="ok"] { color: #56d364; }
.cm-console-status[data-kind="bad"] { color: #ff7b72; }
.cm-console-status[data-kind="warn"] { color: #e3b341; }

.cm-table-wrap { overflow-x: auto; }
.cm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cm-table th {
  text-align: left;
  padding: 12px 20px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6e7781;
  border-bottom: 1px solid #21262d;
  white-space: nowrap;
}
.cm-table td {
  padding: 12px 20px;
  border-bottom: 1px solid #16191f;
  color: #c9d1d9;
  vertical-align: top;
}
.cm-table td span { display: block; margin-top: 3px; font-size: 11px; color: #6e7781; }
.cm-table code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; color: #8b949e; }
.cm-empty { color: #6e7781; }

.cm-tier {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.cm-tier--low { color: #56d364; }
.cm-tier--medium { color: #e3b341; }
.cm-tier--high { color: #ffa657; }
.cm-tier--critical { color: #ff7b72; }

.cm-code {
  display: block;
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #21262d;
  background: #010409;
  color: #a5d6ff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

/* ── FAQ ─────────────────────────────────────────────────────────────────── */

.cm-faq { border: 1px solid #21262d; border-radius: 14px; background: #0d1117; margin-top: 26px; }
.cm-faq details { border-bottom: 1px solid #21262d; }
.cm-faq details:last-child { border-bottom: 0; }
.cm-faq summary {
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 700;
  color: #f4f7fb;
  list-style: none;
}
.cm-faq summary::-webkit-details-marker { display: none; }
.cm-faq summary::after { content: "+"; float: right; color: #38e8ff; font-weight: 700; }
.cm-faq details[open] summary::after { content: "–"; }
.cm-faq p { padding: 0 22px 20px; margin: 0; }

/* ── footer ──────────────────────────────────────────────────────────────── */

.cm-foot {
  padding: 30px clamp(16px, 4vw, 34px);
  color: #6e7781;
  font-size: 12px;
  line-height: 1.8;
  background: #08090c;
}
.cm-foot a { color: #38e8ff; text-decoration: none; }
.cm-foot a:hover, .cm-foot a:focus-visible { color: #fff; text-decoration: underline; }

@media (max-width: 720px) {
  .cm-topbar-actions { margin-left: 0; width: 100%; }
  .cm-workspace { min-height: 620px; }
}

/* ── Theme precedence ────────────────────────────────────────────────────────
 * `assets/css/cg-design-system.css` repaints the site in the mission red/black
 * palette using `!important`, which is right for the marketing pages and wrong
 * around an application. Left alone it puts #FF6470 on the cyan primary button
 * — roughly 2:1, unreadable — retints the status chips red beside a graphite
 * workspace, and sets body copy in the monospace face.
 *
 * The shell pins its own palette back. Everything below is scoped to the `cm-`
 * namespace, so the design system keeps its own components and the ambient page
 * background; only this page's chrome is claimed. Same reasoning as the
 * NAV_EXEMPT entry in tools/design_system.py: a framed application surface owns
 * its chrome.
 */
.cm-page .cm-btn,
.cm-page .cm-chip { font-family: var(--cm-ui, Inter, ui-sans-serif, system-ui, sans-serif) !important; }

.cm-page .cm-btn { color: #e6edf3 !important; background: #161b22 !important; border-color: #30363d !important; }
.cm-page .cm-btn:hover:not(:disabled),
.cm-page .cm-btn:focus-visible:not(:disabled) { color: #fff !important; border-color: #00f0ff !important; }
.cm-page .cm-btn--primary { color: #08090c !important; background: #00f0ff !important; border-color: #00f0ff !important; }
.cm-page .cm-btn--primary:hover,
.cm-page .cm-btn--primary:focus-visible { color: #08090c !important; background: #5ef2ff !important; }

.cm-page .cm-chip { color: #c9d1d9 !important; background: #161b22 !important; border-color: #30363d !important; }
.cm-page .cm-chip--cyan { color: #5ef2ff !important; background: rgba(0,240,255,.10) !important; border-color: rgba(0,240,255,.5) !important; }

.cm-page .cm-crumb { color: #8b949e !important; }
.cm-page .cm-crumb a { color: #38e8ff !important; }
.cm-page .cm-crumb a:hover, .cm-page .cm-crumb a:focus-visible { color: #fff !important; }

.cm-page .cm-eyebrow { color: #38e8ff !important; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; }
.cm-page .cm-section h1,
.cm-page .cm-section h2,
.cm-page .cm-section h3,
.cm-page .cm-faq summary { color: #f4f7fb !important; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif !important; }
.cm-page .cm-section p,
.cm-page .cm-faq p,
.cm-page .cm-list { color: #a7b1bd !important; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif !important; }
.cm-page .cm-section strong { color: #e6edf3 !important; }
.cm-page .cm-card p { color: #8b949e !important; }
.cm-page .cm-card-tag { color: #38e8ff !important; }

.cm-page .cm-banner { color: #bfeeff !important; }
.cm-page .cm-banner strong { color: #5ef2ff !important; }
.cm-page .cm-console-stat b { color: #5ef2ff !important; }
.cm-page .cm-console-stat span,
.cm-page .cm-table th,
.cm-page .cm-table td span,
.cm-page .cm-table code,
.cm-page .cm-empty { color: #6e7781 !important; }
.cm-page .cm-table td { color: #c9d1d9 !important; }
.cm-page .cm-code { color: #a5d6ff !important; }
.cm-page .cm-foot { color: #6e7781 !important; }
.cm-page .cm-foot a { color: #38e8ff !important; }
.cm-page .cm-tier { color: inherit; }
.cm-page .cm-tier--low { color: #56d364 !important; }
.cm-page .cm-tier--medium { color: #e3b341 !important; }
.cm-page .cm-tier--high { color: #ffa657 !important; }
.cm-page .cm-tier--critical { color: #ff7b72 !important; }
