/* ====================================================================
   shared.css — root vars, shell, cards, buttons, grid, utilities
   ==================================================================== */

:root {
  --bg: #fafaf7;
  --bg-soft: #f4f4f0;
  --ink: #14140f;
  --ink-2: #3a3a36;
  --ink-3: #6b6b66;
  --ink-4: #9b9b95;
  --ink-inv: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfbfa;
  --surface-hover: #f7f7f4;
  --border: #ececea;
  --border-2: #e0e0dc;
  --border-strong: #d4d4cf;
  --brand: #ff4d4d;
  --brand-hover: #ff3333;
  --brand-soft: #fff0f0;
  --brand-tint: #fff5f5;
  --success: #10a35a;
  --success-soft: #e8f7ee;
  --warning: #c2780a;
  --warning-soft: #fff3d6;
  --danger: #d23a3a;
  --danger-soft: #fdecec;
  --info: #2a72ff;
  --info-soft: #e7efff;
  --violet: #7c3aed;
  --violet-soft: #f1ebff;
  --pink: #ec4899;
  --pink-soft: #fce7f3;
  --teal: #0d9488;
  --teal-soft: #d8f3ef;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --shadow-xs: 0 1px 2px rgba(20, 20, 15, 0.04);
  --shadow-sm: 0 1px 3px rgba(20, 20, 15, 0.05), 0 1px 2px rgba(20, 20, 15, 0.04);
  --shadow: 0 4px 12px rgba(20, 20, 15, 0.06), 0 2px 4px rgba(20, 20, 15, 0.04);
  --shadow-lg: 0 12px 32px rgba(20, 20, 15, 0.08), 0 4px 12px rgba(20, 20, 15, 0.04);
  --shadow-xl: 0 24px 60px rgba(20, 20, 15, 0.12), 0 8px 24px rgba(20, 20, 15, 0.06);
  --t-fast: 120ms;
  --t: 200ms;
  --t-slow: 320ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
}

.help-page {
  font-family: var(--kdg-font, system-ui, -apple-system, sans-serif);
  color: var(--ink);
}

body.has-sidebar .kdg-main.content {
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  letter-spacing: -0.01em;
  max-width: 1280px;
  padding: 28px 32px 60px;
  min-height: 95vh;
}

@media (max-width: 768px) {
  body.has-sidebar .kdg-main.content { padding: 20px 16px 40px; }
}

/* ---- Page head (section heading) ---- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.page-title em { font-style: italic; color: var(--brand); }
.page-sub {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 6px;
}
.page-actions { flex-shrink: 0; }

/* ---- Card ---- */
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-head-body { flex: 1; min-width: 0; }
.card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0;
}
.card-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 3px;
}
.card-body { flex: none; padding: 24px; }
.card-body-flush { padding: 0; }
.card-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.pill-brand { background: var(--brand-soft); color: var(--brand); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  text-align: inherit;
  vertical-align: baseline;
  border: 1px solid transparent;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.btn svg { width: 15px; height: 15px; stroke-width: 2; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--ink); text-decoration: none; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; border-radius: 9px; line-height: normal; }
.btn-brand { background: var(--brand); color: white; }
.btn-brand:hover { background: var(--brand-hover); color: white; text-decoration: none; }

/* ---- Code inline ---- */
.code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--ink-2);
}

/* ---- Grid-2 ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Stack ---- */
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---- Reset Bootstrap leaks ---- */
.help-page a { color: inherit; }
.help-page p { margin-bottom: 0; }
.help-page ul, .help-page ol { margin-top: 0; margin-bottom: 0; padding-left: 0; }
.help-page dl { margin-bottom: 0; }

/* ---- Utility spacing ---- */
.mb-12 { margin-bottom: 72px; }
.mb-10 { margin-bottom: 56px; }
.mb-6 { margin-bottom: 32px; }

/* ---- Toast: handled by the global Kdg.toast (css/components/toast.css) ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---- Shared: empty state ---- */
.help-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
