/* Field Link Missions — documentation pages (generated by site/docs/build.js from site/docs/src) */
:root {
  --bg:       #0f1117;
  --surface:  #161921;
  --surface2: #1e2130;
  --surface3: #252a3a;
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.12);
  --text:     #e8eaf0;
  --text-muted: #8b91a8;
  --gold:     #e8b84b;
  --gold-dim: rgba(232,184,75,0.1);
  --accent:   #4d9de0;
  --success:  #4ade80;
  --danger:   #f87171;
  --warn:     #fbbf24;
  --font-display: 'Sora', sans-serif;
  --font-body:    'Inter', sans-serif;
  --sidebar-w: 260px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 80px; } /* in-page links scroll smoothly via docs.js; a fragment in the URL jumps straight there */
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.7; }

/* Top nav */
#topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 60px; display: flex; align-items: center; gap: 20px;
  padding: 0 28px;
  background: rgba(15,17,23,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
#topnav a.logo { font-family: var(--font-display); font-weight: 700; color: var(--gold); text-decoration: none; font-size: 1.05rem; white-space: nowrap; flex-shrink: 0; }
#topnav .sep { color: var(--border2); }
#topnav .page-title { color: var(--text-muted); font-size: 0.88rem; }
#topnav .spacer { flex: 1; }
#topnav a.back-link { font-size: 0.82rem; color: var(--text-muted); text-decoration: none; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; }
#topnav a.back-link:hover { border-color: var(--gold); color: var(--gold); }
#search-wrap { position: relative; }
#doc-search { padding: 7px 14px 7px 34px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: var(--font-body); font-size: 0.83rem; outline: none; width: 200px; }
#doc-search:focus { border-color: var(--gold); width: 260px; transition: width 0.2s; }
#search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }
#search-results { position: absolute; top: calc(100% + 6px); right: 0; width: 340px; background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); display: none; z-index: 300; max-height: 340px; overflow-y: auto; }
.sr-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 0.83rem; }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--surface2); }
.sr-item .sr-section { font-size: 0.72rem; color: var(--gold); margin-bottom: 2px; }

/* Layout */
#layout { display: flex; flex-direction: row; min-height: 100vh; padding-top: 60px; }

/* Sidebar */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 60px; height: calc(100vh - 60px);
  overflow-y: auto; padding: 24px 0 40px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.nav-section { padding: 0 16px; margin-bottom: 4px; margin-top: 20px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.nav-section:first-child { margin-top: 0; }
#sidebar a { display: flex; align-items: center; gap: 8px; padding: 7px 16px; font-size: 0.83rem; color: var(--text-muted); text-decoration: none; border-left: 2px solid transparent; transition: all 0.12s; }
#sidebar a:hover { color: var(--text); background: var(--surface2); }
#sidebar a.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-dim); }
#sidebar a .ico { width: 16px; text-align: center; flex-shrink: 0; }

/* Content */
#content { flex: 1; min-width: 0; padding: 48px 56px 80px; max-width: 900px; }
#content img { max-width: 100%; height: auto; }
#content pre { overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
#content code { word-break: break-word; }
#content a { word-break: break-word; }

/* Page body */
.doc-section { margin-bottom: 0; }
.doc-section h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--text); margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.doc-section h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 32px 0 12px; }
.doc-section h3 { font-size: 1rem; font-weight: 600; color: var(--gold); margin: 24px 0 8px; }
.doc-section p { color: var(--text-muted); margin-bottom: 12px; }
.doc-section ul, .doc-section ol { color: var(--text-muted); margin: 8px 0 12px 20px; }
.doc-section li { margin-bottom: 6px; }
.doc-section li strong { color: var(--text); }
.doc-section a { color: var(--gold); }

/* Callout boxes */
.callout { border-radius: 10px; padding: 14px 18px; margin: 16px 0; font-size: 0.88rem; }
.callout.tip  { background: rgba(77,157,224,0.08); border: 1px solid rgba(77,157,224,0.2); }
.callout.warn { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2); }
.callout.info { background: var(--surface2); border: 1px solid var(--border); }
.callout-title { font-weight: 600; margin-bottom: 4px; }
.callout.tip  .callout-title { color: var(--accent); }
.callout.warn .callout-title { color: var(--warn); }
.callout.info .callout-title { color: var(--text); }

/* Steps */
.steps { counter-reset: step; margin: 16px 0; }
.step { display: flex; gap: 14px; margin-bottom: 16px; }
.step::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--bg); font-weight: 700; font-size: 0.78rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.step-body strong { display: block; color: var(--text); margin-bottom: 3px; }
.step-body p, .step-body span { color: var(--text-muted); font-size: 0.88rem; }

/* Role table */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.86rem; }
th { background: var(--surface2); padding: 10px 14px; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
td:first-child { color: var(--text); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Tag badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; margin: 0 2px; }
.badge.green  { background: rgba(74,222,128,0.12); color: var(--success); }
.badge.gold   { background: var(--gold-dim); color: var(--gold); }
.badge.blue   { background: rgba(77,157,224,0.12); color: var(--accent); }
.badge.red    { background: rgba(248,113,113,0.12); color: var(--danger); }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.faq-q { padding: 14px 18px; cursor: pointer; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; align-items: center; user-select: none; }
.faq-q:hover { background: var(--surface2); }
.faq-q .arrow { color: var(--text-muted); transition: transform 0.2s; }
.faq-item.open .faq-q .arrow { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 18px 14px; color: var(--text-muted); font-size: 0.88rem; line-height: 1.7; border-top: 1px solid var(--border); padding-top: 12px; }
.faq-item.open .faq-a { display: block; }

/* CanaKit one-click "buy it assembled" button */
#canakit-buy { margin: 12px 0 4px; max-width: 460px; }
#canakit-buy-btn { display: block; width: 100%; padding: 12px 18px; font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; border: 0; border-radius: 10px; background: var(--gold); color: var(--bg); cursor: pointer; }
#canakit-buy-btn:hover { filter: brightness(1.08); }
#canakit-buy-btn:disabled { opacity: 0.6; cursor: default; }
#canakit-buy-status { min-height: 1.2em; margin: 8px 0 0; font-size: 0.82rem; }
#canakit-buy details { margin-top: 6px; font-size: 0.82rem; color: var(--text-muted); }
#canakit-buy summary { cursor: pointer; }
#canakit-buy ol { margin: 6px 0 0 20px; }

/* Previous / next page */
#pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
#pager a { display: flex; flex-direction: column; gap: 2px; max-width: 48%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; transition: border-color 0.12s; }
#pager a:hover { border-color: var(--gold); }
#pager a.next { margin-left: auto; text-align: right; }
#pager .pager-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
#pager .pager-title { font-size: 0.9rem; font-weight: 600; color: var(--gold); }
#pager:empty { display: none; }

/* On-this-page */
#otp { position: sticky; top: 80px; align-self: flex-start; width: 200px; flex-shrink: 0; padding: 24px 0 24px 20px; display: none; }
@media (min-width: 1200px) { #otp { display: block; } #content { max-width: 820px; } }
#otp .otp-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 700; margin-bottom: 10px; }
#otp a { display: block; font-size: 0.78rem; color: var(--text-muted); text-decoration: none; padding: 4px 0; border-left: 2px solid var(--border); padding-left: 10px; }
#otp a:hover, #otp a.active { color: var(--gold); border-left-color: var(--gold); }

/* Mobile sidebar toggle */
#mob-menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }
#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 149; }
/* Tablet */
@media (max-width: 1100px) {
  #content { padding: 36px 28px 80px; }
}

/* Mobile */
@media (max-width: 768px) {
  body { overflow-x: hidden; }
  #mob-menu-btn { display: block; }
  #topnav { padding: 0 14px; gap: 10px; }
  #topnav .sep { display: none; }
  #topnav .page-title { display: none; }
  #topnav a.back-link { display: none; }
  #topnav a.logo { font-size: 0.9rem; }
  #search-wrap { flex: 1; }
  #doc-search { width: 100%; font-size: 0.8rem; padding: 7px 12px 7px 30px; }
  #doc-search:focus { width: 100%; }
  #search-results { width: calc(100vw - 28px); right: auto; left: 0; }
  #sidebar { position: fixed; top: 60px; left: -280px; height: calc(100vh - 60px); z-index: 150; transition: left 0.25s; }
  #sidebar.open { left: 0; }
  #sidebar-overlay.open { display: block; }
  #layout { flex-direction: column; }
  #content { padding: 20px 16px 60px; width: 100%; max-width: 100%; overflow-x: hidden; box-sizing: border-box; }
  .doc-section { overflow-x: hidden; }
  .doc-section h1 { font-size: 1.4rem; word-break: break-word; }
  .doc-section h2 { font-size: 1.05rem; }
  .doc-section p, .doc-section li { font-size: 0.9rem; }
  /* Tables — horizontal scroll instead of overflow */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 0.78rem; min-width: 400px; }
  th, td { padding: 7px 9px; }
  /* Code blocks */
  pre, code { font-size: 0.78rem; word-break: break-all; white-space: pre-wrap; }
  /* Callouts */
  .callout { padding: 12px 14px; }
  /* Steps */
  .steps .step { gap: 10px; flex-direction: column; }
  .step-num { flex-shrink: 0; }
  /* Callout titles */
  .callout-title { font-size: 0.8rem; }
  /* ol/ul spacing */
  .doc-section ol, .doc-section ul { padding-left: 20px; }
  #pager { flex-direction: column; }
  #pager a, #pager a.next { max-width: 100%; margin-left: 0; }
}
  

/* Sidebar sub-entries and topnav title link (added with the per-page build) */
#sidebar a[data-sub] { padding-left: 32px; font-size: 0.82rem; }
#topnav a.page-title { text-decoration: none; }
#topnav a.page-title:hover { color: var(--text); }
a.sr-item { display: block; color: var(--text); text-decoration: none; }
