/* ─────────────────────────────────────────────────────────────
   Kai Support — shared stylesheet
   Fonts: Space Grotesk (headings) · Inter (body)
   Colors: #17171B charcoal · #5B4FE8 indigo · #F2F3F6 cool grey
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --charcoal:    #17171B;
  --charcoal-2:  #222228;
  --charcoal-3:  #2C2C34;
  --indigo:      #5B4FE8;
  --indigo-soft: rgba(91,79,232,.12);
  --grey:        #F2F3F6;
  --border:      #E2E4E9;
  --text:        #17171B;
  --text-2:      #6B6F76;
  --text-3:      #9CA0A8;
  --sidebar-w:   260px;
  --topbar-h:    56px;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--grey);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--charcoal);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
  border-bottom: 1px solid var(--charcoal-3);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.topbar-logo span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--charcoal-3);
}

.topbar-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  letter-spacing: .2px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right a {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .15s;
}

.topbar-right a:hover { color: rgba(255,255,255,.85); }

.topbar-app-link {
  font-size: 12px;
  font-weight: 600;
  color: #fff !important;
  background: var(--indigo);
  padding: 6px 13px;
  border-radius: 7px;
  text-decoration: none !important;
  transition: opacity .15s;
}

.topbar-app-link:hover { opacity: .88; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--charcoal);
  overflow-y: auto;
  padding: 24px 0 40px;
  border-right: 1px solid var(--charcoal-3);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--charcoal-3); border-radius: 2px; }

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 0 18px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  font-size: 13.5px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .12s, background .12s;
  line-height: 1.3;
}

.sidebar-link:hover {
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.04);
}

.sidebar-link.active {
  color: #fff;
  border-left-color: var(--indigo);
  background: rgba(91,79,232,.12);
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: .5;
}

.sidebar-link.active svg { opacity: 1; }

/* ── Main content ───────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 52px 40px 100px;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 28px;
}

.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--indigo); }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--text-2); }

/* ── Article header ─────────────────────────────────────────── */
.article-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 10px;
}

.article-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.15;
  color: var(--charcoal);
  margin-bottom: 14px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.article-meta-dot {
  width: 3px; height: 3px;
  background: var(--border);
  border-radius: 50%;
}

.article-lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-2);
  margin-bottom: 40px;
}

/* ── Article body ───────────────────────────────────────────── */
.article h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--charcoal);
  margin: 44px 0 14px;
}

.article h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--charcoal);
  margin: 28px 0 10px;
}

.article p {
  font-size: 15px;
  line-height: 1.7;
  color: #3A3D44;
  margin-bottom: 16px;
}

.article ul, .article ol {
  margin: 0 0 18px 0;
  padding-left: 20px;
}

.article li {
  font-size: 15px;
  line-height: 1.7;
  color: #3A3D44;
  margin-bottom: 6px;
}

.article strong { color: var(--charcoal); font-weight: 600; }

.article a { color: var(--indigo); text-decoration: none; }
.article a:hover { text-decoration: underline; }

/* ── Screenshot / image ─────────────────────────────────────── */
.screenshot {
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--charcoal);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-caption {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-3);
  background: #fff;
  border-top: 1px solid var(--border);
}

/* ── Screenshot placeholder (before real images) ─────────────── */
.screenshot-placeholder {
  margin: 28px 0;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 36px 24px;
  text-align: center;
  background: #fff;
}

.screenshot-placeholder-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 4px;
}

.screenshot-placeholder p {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}

/* ── Callout boxes ──────────────────────────────────────────── */
.callout {
  border-radius: 8px;
  padding: 16px 18px;
  margin: 22px 0;
  font-size: 14px;
  line-height: 1.6;
}

.callout-info {
  background: rgba(91,79,232,.07);
  border-left: 3px solid var(--indigo);
  color: #3A3D44;
}

.callout-info strong { color: var(--indigo); }

.callout-warning {
  background: rgba(230,160,40,.08);
  border-left: 3px solid #E6A028;
  color: #3A3D44;
}

.callout-warning strong { color: #B87E20; }

/* ── Step list (numbered process steps) ─────────────────────── */
.steps { margin: 24px 0; }

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--indigo);
  color: #fff;
  border-radius: 50%;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step-body { flex: 1; }

.step-body strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.step-body p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
}

/* ── Code / token blocks ────────────────────────────────────── */
.token-block {
  background: var(--charcoal);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.token-block code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13.5px;
  color: #A79FF2;
  letter-spacing: .2px;
}

.token-copy {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.12);
  background: transparent;
  border-radius: 5px;
  padding: 4px 10px;
  transition: all .15s;
  flex-shrink: 0;
}

.token-copy:hover {
  color: rgba(255,255,255,.8);
  border-color: rgba(255,255,255,.3);
}

.token-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13.5px;
}

.token-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--grey);
  border-bottom: 1px solid var(--border);
}

.token-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: #3A3D44;
}

.token-table tr:last-child td { border-bottom: none; }

.token-table code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  color: var(--indigo);
  background: var(--indigo-soft);
  padding: 2px 7px;
  border-radius: 4px;
}

/* ── Next / prev article nav ────────────────────────────────── */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}

.article-nav-link:hover {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.article-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-3);
}

.article-nav-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
}

.article-nav-link.next { text-align: right; }

/* ── Home page grid ─────────────────────────────────────────── */
.home-hero {
  background: var(--charcoal);
  padding: 56px 40px 48px;
  margin-bottom: 0;
}

.home-hero-inner { max-width: 760px; margin: 0 auto; }

.home-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: #fff;
  margin-bottom: 10px;
}

.home-hero p {
  font-size: 16px;
  color: rgba(255,255,255,.5);
  max-width: 520px;
}

.home-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 40px 100px;
}

.home-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  margin-top: 44px;
}

.home-section-label:first-child { margin-top: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  display: block;
  transition: border-color .15s, box-shadow .15s;
}

.card:hover {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.card-icon {
  width: 32px; height: 32px;
  background: var(--indigo-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 5px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 32px 20px 80px; }
  .card-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 26px; }
  .home-hero { padding: 36px 20px 32px; }
  .home-content { padding: 32px 20px 80px; }
  .article-nav { grid-template-columns: 1fr; }
}

/* ── Soon badge (non-existent pages) ───────────────────────── */
.sidebar-link-soon {
  display: flex;
  align-items: center;
  padding: 7px 18px;
  font-size: 13.5px;
  color: rgba(255,255,255,.22);
  border-left: 2px solid transparent;
  cursor: default;
  line-height: 1.3;
}

.soon-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.07);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── UI mockup screenshots ──────────────────────────────────── */
.mockup {
  background: #F2F3F6;
  padding: 24px;
}

.mockup-panel {
  background: #fff;
  border: 1px solid #E2E4E9;
  border-radius: 12px;
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: #17171B;
}

.mockup-panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid #E2E4E9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mockup-panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #17171B;
}

.mockup-panel-body { padding: 18px; }

.mockup-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #9CA0A8;
  margin-bottom: 6px;
}

.mockup-input {
  width: 100%;
  border: 1px solid #E2E4E9;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 13px;
  color: #17171B;
  background: #fff;
  margin-bottom: 14px;
  font-family: inherit;
}

.mockup-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.mockup-input-row .mockup-input { margin-bottom: 0; }

.mockup-btn {
  background: #5B4FE8;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  font-family: inherit;
  cursor: default;
}

.mockup-btn-ghost {
  background: #fff;
  color: #17171B;
  border: 1px solid #E2E4E9;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: default;
}

.mockup-step-list { margin: 4px 0 0; }

.mockup-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #F2F3F6;
  font-size: 12.5px;
}

.mockup-step-row:last-child { border-bottom: none; }

.mockup-step-day {
  width: 36px;
  font-size: 11px;
  font-weight: 600;
  color: #9CA0A8;
  flex-shrink: 0;
}

.mockup-step-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.mockup-step-type.e  { background: rgba(91,79,232,.1); color: #5B4FE8; }
.mockup-step-type.li { background: rgba(0,119,181,.1); color: #0077B5; }
.mockup-step-type.c  { background: rgba(30,160,80,.1); color: #1E9650; }

.mockup-token-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #17171B;
  border-radius: 7px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.mockup-token-row code {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  color: #A79FF2;
}

.mockup-copy {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px;
  padding: 3px 8px;
  background: transparent;
  cursor: default;
  flex-shrink: 0;
}

.mockup-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #9CA0A8;
  padding: 0 18px;
  margin: 14px 0 8px;
}

.mockup-approval-card {
  background: #fff;
  border: 1px solid #E2E4E9;
  border-radius: 11px;
  overflow: hidden;
  max-width: 540px;
  margin: 0 auto;
  font-family: 'Inter', system-ui, sans-serif;
}

.mockup-approval-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #E2E4E9;
}

.mockup-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #5B4FE8;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.mockup-approval-name { font-size: 14px; font-weight: 600; color: #17171B; }
.mockup-approval-meta { font-size: 12px; color: #6B6F76; }

.mockup-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #E2E4E9;
  padding: 0 16px;
}

.mockup-tab {
  font-size: 12.5px;
  font-weight: 500;
  color: #9CA0A8;
  padding: 9px 12px;
  border-bottom: 2px solid transparent;
  cursor: default;
}

.mockup-tab.active {
  color: #5B4FE8;
  border-bottom-color: #5B4FE8;
  font-weight: 600;
}

.mockup-email-preview {
  padding: 14px 16px;
  font-size: 13px;
  color: #3A3D44;
  line-height: 1.6;
}

.mockup-email-subject {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #9CA0A8;
  margin-bottom: 4px;
}

.mockup-email-body {
  font-size: 13px;
  color: #3A3D44;
  line-height: 1.6;
}

.mockup-approval-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #E2E4E9;
  background: #FAFAFA;
}
