/* Platform Guide overlay.
   Scoped under #tk-pg-root so styles can't leak into LibreChat chrome.
   Brand red (#D42718) matches the existing custom.css token. Type stack
   mirrors the archived Mission Planning preview (Crimson Pro display +
   IBM Plex body/mono); swap for the production brand stack once confirmed. */

@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400;1,600&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

#tk-pg-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0a0a0a;
  color: #e9e9e9;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#tk-pg-root *,
#tk-pg-root *::before,
#tk-pg-root *::after {
  box-sizing: border-box;
}

#tk-pg-root .tk-pg-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 48px 96px;
}

@media (max-width: 720px) {
  #tk-pg-root .tk-pg-container {
    padding: 32px 20px 64px;
  }
}

/* Close button — top-right, always reachable */
#tk-pg-root .tk-pg-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #aaa;
  cursor: pointer;
  z-index: 2;
  transition: background-color 120ms ease, color 120ms ease,
    border-color 120ms ease;
}
#tk-pg-root .tk-pg-close:hover,
#tk-pg-root .tk-pg-close:focus-visible {
  background: #1a1a1a;
  color: #fff;
  border-color: #3a3a3a;
  outline: none;
}
#tk-pg-root .tk-pg-close:focus-visible {
  box-shadow: 0 0 0 2px #d42718;
}

/* ── Hero ─────────────────────────────────────────────────────── */
#tk-pg-root .tk-pg-hero {
  padding-top: 8px;
  margin-bottom: 24px;
}
#tk-pg-root .tk-pg-pill {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: #d42718;
  padding: 4px 10px;
  border-radius: 2px;
  margin-bottom: 24px;
}
#tk-pg-root .tk-pg-title {
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: #f5f5f5;
}
#tk-pg-root .tk-pg-title em {
  font-style: italic;
  font-weight: 400;
  color: #fff;
}
#tk-pg-root .tk-pg-subtitle {
  font-family: "Crimson Pro", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.45;
  color: #c8c8c8;
  margin: 0 0 24px;
  max-width: 820px;
}
#tk-pg-root .tk-pg-context {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #888;
  text-transform: uppercase;
  margin: 0;
}

/* ── Section ──────────────────────────────────────────────────── */
#tk-pg-root .tk-pg-section {
  margin-top: 72px;
}
#tk-pg-root .tk-pg-section-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
  margin: 0 0 12px;
}
#tk-pg-root .tk-pg-section-heading {
  font-family: "Crimson Pro", Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.15;
  margin: 0 0 16px;
  color: #f5f5f5;
}
#tk-pg-root .tk-pg-section-intro {
  font-size: 16px;
  line-height: 1.6;
  color: #c0c0c0;
  margin: 0 0 32px;
  max-width: 820px;
}

/* ── Cards ────────────────────────────────────────────────────── */
#tk-pg-root .tk-pg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
#tk-pg-root .tk-pg-card {
  background: #111;
  border: 1px solid #1a1a1a;
  border-left: 3px solid #d42718;
  padding: 24px 24px 22px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}
#tk-pg-root .tk-pg-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
#tk-pg-root .tk-pg-card-title {
  font-family: "Crimson Pro", Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
  color: #f5f5f5;
}
#tk-pg-root .tk-pg-card-tag {
  flex-shrink: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d6d6d6;
  background: #1d1d1d;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding: 3px 8px;
  white-space: nowrap;
}
#tk-pg-root .tk-pg-card-body {
  margin: 0 0 16px;
  color: #c8c8c8;
  font-size: 15px;
  line-height: 1.55;
}
#tk-pg-root .tk-pg-card-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
#tk-pg-root .tk-pg-card-bullets li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 14px;
  color: #d6d6d6;
  border-bottom: 1px solid #1a1a1a;
}
#tk-pg-root .tk-pg-card-bullets li:last-child {
  border-bottom: 0;
}
#tk-pg-root .tk-pg-card-bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 13px;
  width: 5px;
  height: 5px;
  background: #d42718;
  border-radius: 50%;
}
#tk-pg-root .tk-pg-card-meta {
  margin-top: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: #888;
  border-top: 1px solid #1a1a1a;
  padding-top: 12px;
}

/* ── Footer ───────────────────────────────────────────────────── */
#tk-pg-root .tk-pg-footer {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid #1a1a1a;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: #888;
  line-height: 1.7;
}

/* ── Nav-rail entry ────────────────────────────────────────────
   The sidebar button is added by panel.js (see patch-index.sh). Unlike the
   archived Mission Planning button, the guide is live — no "coming soon"
   red-dot indicator. */
.tk-pg-rail-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 4px 0;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
}
.tk-pg-rail-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
.tk-pg-rail-btn .tk-pg-rail-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
