/* Page layout for the contextgit web app. Colours, type, spacing and radii come from the design tokens (tokens.css);
   component styles are the design system's own (design.css). Nothing here hard-codes a colour. */

html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
p { margin-block: 0 var(--space-3); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
a.cg-btn, a.cg-btn:hover, a.cg-tab, a.cg-tab:hover, a.cg-card-title:hover { text-decoration: none; }
a.cg-btn-primary, a.cg-btn-primary:hover { color: var(--on-accent); }
a.cg-btn-danger { color: var(--removed); }
.muted { color: var(--ink-muted); }
.t-body-strong { font-family: var(--font-sans); font-size: 14px; line-height: 22px; font-weight: 600; }

/* shell */
.topbar { border-bottom: 1px solid var(--border); background: var(--canvas); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--space-5); height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { font: 600 18px/1 var(--font-sans); letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); }
.topbar-actions form { margin: 0; }
.container { max-width: 1280px; margin: 0 auto; padding: var(--space-6) var(--space-5) var(--space-7); }
.narrow { max-width: 28rem; margin: var(--space-6) auto; }
.narrow .t-heading-1 { margin-bottom: var(--space-3); }

/* page structure */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); flex-wrap: wrap; }
.section { margin-top: var(--space-6); }
.section > .t-heading-2 { margin-bottom: var(--space-2); }
.section-flush { padding-top: var(--space-5); }
.section-flush > .t-heading-2 { margin-bottom: var(--space-3); }
.lead { margin-bottom: var(--space-5); }
.grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid .cg-card { max-width: none; }
.layout-two { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); padding-top: var(--space-5); }
.layout-two > aside { order: 2; }                 /* on a phone the content comes first */
@media (min-width: 768px) {
  .layout-two { grid-template-columns: 256px minmax(0, 1fr); }
  .layout-two > aside { order: 0; }
}
.meta-list { margin: 0; }
.meta-list dt { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); margin-bottom: var(--space-1); }
.meta-list dd { margin: 0 0 var(--space-4); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; overflow-wrap: anywhere; }

/* context header */
.ctx-title { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-2); }
.ctx-name { color: var(--ink); overflow-wrap: anywhere; }
.ctx-owner { color: var(--ink-muted); }
.ctx-owner:hover { color: var(--ink); text-decoration: none; }
.ctx-labels { display: inline-flex; gap: var(--space-2); }
.ctx-desc { margin-bottom: var(--space-4); }
.cg-tabs { padding: 0; margin: var(--space-4) 0 0; overflow-x: auto; scrollbar-width: none; }
.cg-tab { flex: none; white-space: nowrap; }
.cg-tab { text-decoration: none; }
.cg-tab[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* the text is the loudest thing on the page: mono on canvas-sunken */
pre.cg-code, textarea.cg-editor { font: 400 13px/20px var(--font-mono); color: var(--ink); background: var(--canvas-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-4); margin: 0; box-sizing: border-box; }
pre.cg-code { white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.cg-editor { display: block; width: 100%; min-height: 12rem; resize: vertical; border-color: var(--border-strong); }
textarea.cg-editor:focus { background: var(--canvas); outline: 2px solid var(--focus); outline-offset: 2px; }
textarea.cg-editor::placeholder { color: var(--ink-muted); }

/* forms */
.field-stack { display: flex; flex-direction: column; gap: var(--space-4); max-width: 32rem; }
.field-stack.wide { max-width: 52rem; }
.cg-field { min-width: 0; }
select.cg-input { appearance: auto; padding-right: var(--space-3); }
.inline-form { display: flex; align-items: flex-end; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; }
.actions { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); flex-wrap: wrap; }
.actions form { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0; }
a.cg-label:hover { background: var(--canvas-subtle); text-decoration: none; }
a.cg-label.cg-label-accent:hover { background: var(--accent-soft); }

/* messages and empty states */
.banner { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--canvas-subtle); color: var(--ink); margin-bottom: var(--space-4); }
.banner-attention { background: var(--attention-soft); border-color: transparent; }
.banner-error { background: var(--removed-soft); border-color: transparent; }
.cg-empty { text-align: center; padding: var(--space-7) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.cg-empty .t-heading-2 { margin-bottom: var(--space-2); }
.cg-empty p { max-width: 32rem; margin-inline: auto; margin-bottom: var(--space-4); }
.danger-zone { margin-top: var(--space-6); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); max-width: 32rem; }
.danger-zone .t-heading-3 { margin-bottom: var(--space-1); }

/* design system pieces that need a little page-level help */
.cg-avatar-20 { width: 20px; height: 20px; font-size: 8px; }
.cg-avatar-24 { width: 24px; height: 24px; font-size: 10px; }
.cg-avatar-28 { width: 28px; height: 28px; font-size: 11px; }
.cg-avatar-48 { width: 48px; height: 48px; font-size: 19px; }
.cg-commit-msg { text-decoration: none; }
.cg-commit-msg:hover { color: var(--link); text-decoration: none; }
.cg-diff-gap { background: var(--canvas-subtle); color: var(--ink-muted); }
.cg-diff-gap .cg-diff-text { padding-left: 0; }
.cg-list > .cg-commit { gap: var(--space-3); }
.cg-meta .cg-icon { margin-right: var(--space-1); }

.scope-list { padding-left: var(--space-5); margin: 0 0 var(--space-4); }
.scope-list li { margin-bottom: var(--space-3); }
.small { font-size: 12px; line-height: 16px; }
.push-right { margin-left: auto; }
.gap-top { margin-top: var(--space-5); margin-bottom: var(--space-3); }

/* the connector address and the steps on /connect */
.cg-mono { font-family: var(--font-mono); }
.steps { margin: var(--space-4) 0; padding-left: var(--space-5); color: var(--ink); }
.steps li { margin-bottom: var(--space-2); }

/* admin: numbers and plain tables, borders not shadows */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); margin: 0; }
.stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.stat dt { color: var(--ink-muted); font-size: 13px; }
.stat dd { margin: var(--space-1) 0 0; font-size: 20px; font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.data-table th { color: var(--ink-muted); font-weight: 500; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* a checkbox with its label on one line */
.check-row { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }

/* the public landing page */
.hero { max-width: 40rem; margin: var(--space-7) 0 var(--space-6); }
.hero .t-display { margin-bottom: var(--space-4); }
.hero-lead { margin-bottom: var(--space-5); }
.hero-form { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; }
.hero-form .cg-field { flex: 1 1 16rem; margin: 0; }
.hero-note { margin-top: var(--space-3); }
.features { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.trust { text-align: center; margin: var(--space-6) 0; }
/* a field only a bot fills in: out of sight, out of the tab order */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
