/* ═══════════════════════════════════════════════════════════════════════
   Elastic LLA Walkthrough Server — Design System
   Colors: #0B64CA blue | #00BFB3 teal | #343741 dark | #F5F7FA light-bg
   Font: Inter (Google Fonts)
   ═══════════════════════════════════════════════════════════════════════ */

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

/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:               #0B64CA;
  --blue-dark:          #0952A5;
  --blue-light:         #D3E4F5;
  --teal:               #00BFB3;
  --teal-dark:          #00958C;
  --dark:               #343741;
  --dark-2:             #25262E;
  --mid:                #535966;
  --muted:              #8D919C;
  --border:             #D3DAE6;
  --bg:                 #F5F7FA;
  --white:              #FFFFFF;
  --code-bg:            #1D1E24;
  --code-border:        #2E3039;
  --success:            #017D73;
  --danger:             #BD271E;
  --radius:             8px;
  --radius-lg:          12px;
  --shadow-sm:          0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:          0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:          0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --nav-h:              60px;
  --sidebar-w:          260px;
  --sidebar-collapsed-w:56px;
  --kibana-pane-w:      52vw;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Top nav ──────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--dark-2);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.07);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo svg { display: block; }

.nav-wordmark {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
}

.nav-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.3px;
}

.nav-spacer { flex: 1; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-username {
  font-size: 13px;
  color: rgba(255,255,255,.55);
}

.btn-logout {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.btn-logout:hover {
  color: var(--white);
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.06);
}

/* ── Page layout ──────────────────────────────────────────────────────── */
.page-wrap {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Login page ───────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0D1117 0%, #1A1D27 50%, #0B1929 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.login-header {
  background: var(--dark-2);
  padding: 36px 40px 28px;
  text-align: center;
}

.login-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.login-wordmark {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.4px;
}

.login-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  font-weight: 400;
}

.login-body {
  padding: 36px 40px 40px;
}

.login-welcome {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}

.login-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--dark);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11,100,202,.12);
  background: var(--white);
}
.form-input::placeholder { color: var(--muted); }

.btn-signin {
  width: 100%;
  padding: 12px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}
.btn-signin:hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(11,100,202,.35);
}
.btn-signin:active { transform: translateY(1px); }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #FFF1F0;
  border: 1px solid #FFC0BC;
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.login-error-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.login-footer-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Home page ────────────────────────────────────────────────────────── */
.home-hero {
  background: linear-gradient(135deg, var(--dark-2) 0%, #1C2A3A 100%);
  padding: 56px 40px 52px;
  border-bottom: 3px solid var(--blue);
}

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

.home-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal);
  margin-bottom: 14px;
}

.home-label-dot {
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.home-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.home-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,.55);
  max-width: 560px;
  line-height: 1.6;
}

.home-meta {
  display: flex;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.home-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.45);
}

.home-meta-item strong {
  color: rgba(255,255,255,.75);
  font-weight: 600;
}

/* ── Step cards grid ──────────────────────────────────────────────────── */
.steps-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 40px 60px;
}

.section-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 20px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.step-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.step-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.step-card:hover::before { transform: scaleX(1); }

.step-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-time-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.step-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}

.step-card-desc {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.55;
  flex: 1;
}

.step-card-arrow {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  margin-top: 4px;
}

/* ── Step detail page ─────────────────────────────────────────────────── */
.step-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 0;
  z-index: 10;
  transition: width 0.25s ease;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-steps { list-style: none; }

.sidebar-step-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  text-decoration: none;
  color: var(--mid);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  position: relative;
}

.sidebar-step-link:hover {
  background: var(--bg);
  color: var(--dark);
}

.sidebar-step-link.active {
  color: var(--blue);
  font-weight: 600;
  background: rgba(11,100,202,.05);
}

.sidebar-step-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
}

.sidebar-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--border);
  color: var(--mid);
  transition: background 0.12s, color 0.12s;
}

.sidebar-step-link.active .sidebar-num {
  background: var(--blue);
  color: var(--white);
}

/* Main content area */
.step-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease, margin-right 0.25s ease;
}

.step-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 24px 48px 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb-sep { color: var(--border); }

.step-header-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-header-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(11,100,202,.3);
}

.step-header-info { flex: 1; }

.step-header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.step-header-time {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* Markdown content */
.step-content {
  padding: 40px 48px;
  flex: 1;
  max-width: 900px;
}

/* ── Markdown typography ──────────────────────────────────────────────── */
.md-body h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.4px;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.md-body h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-top: 40px;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

.md-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  margin-top: 28px;
  margin-bottom: 10px;
}

.md-body h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mid);
  margin-top: 24px;
  margin-bottom: 8px;
}

.md-body p {
  margin-bottom: 16px;
  color: var(--dark);
  line-height: 1.7;
}

.md-body ul, .md-body ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

.md-body li {
  margin-bottom: 6px;
  line-height: 1.6;
  color: var(--dark);
}

.md-body li::marker { color: var(--blue); }

.md-body strong { font-weight: 700; color: var(--dark); }
.md-body em { font-style: italic; color: var(--mid); }

.md-body a { color: var(--blue); text-decoration: none; }
.md-body a:hover { text-decoration: underline; }

.md-body hr {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 36px 0;
}

/* Blockquotes — used for speaker notes */
.md-body blockquote {
  border-left: 4px solid var(--teal);
  background: linear-gradient(90deg, rgba(0,191,179,.05) 0%, transparent 100%);
  margin: 20px 0;
  padding: 14px 18px 14px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.md-body blockquote p {
  margin: 0;
  font-style: italic;
  color: var(--mid);
  font-size: 14px;
}

/* Tables */
.md-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13px;
}

.md-body th {
  background: var(--bg);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--dark);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.md-body td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  color: var(--dark);
  vertical-align: top;
  line-height: 1.5;
}

.md-body tr:nth-child(even) td { background: rgba(245,247,250,.6); }

/* Inline code */
.md-body code:not(pre code) {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  background: #EEF1F7;
  color: #A31515;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Code blocks */
.md-body pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  overflow: hidden;
}

.md-body pre code {
  display: block;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: #D4D4D4;
  padding: 20px 20px 20px 20px;
  overflow-x: auto;
  line-height: 1.65;
  white-space: pre;
  background: transparent;
  border: none;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.3px;
}

.copy-btn:hover {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
}

.copy-btn.copied {
  color: var(--teal);
  border-color: rgba(0,191,179,.3);
  background: rgba(0,191,179,.08);
}

/* ── Step nav (prev/next) ─────────────────────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px 40px;
  border-top: 1px solid var(--border);
  background: var(--white);
  margin-top: 16px;
  gap: 16px;
}

.step-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  min-width: 180px;
}

.step-nav-btn-prev {
  color: var(--mid);
  border: 1.5px solid var(--border);
  background: var(--white);
}

.step-nav-btn-prev:hover {
  color: var(--dark);
  border-color: var(--dark);
  background: var(--bg);
}

.step-nav-btn-next {
  color: var(--white);
  background: var(--blue);
  border: 1.5px solid var(--blue);
  margin-left: auto;
  justify-content: flex-end;
}

.step-nav-btn-next:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(11,100,202,.3);
}

.step-nav-btn-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

.step-nav-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.step-nav-hint {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.6;
}

.step-nav-name {
  font-size: 13px;
  font-weight: 600;
}

/* ── Architecture card ────────────────────────────────────────────────── */
.arch-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  margin: 0 48px 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.arch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.arch-card-header:hover { background: var(--blue-light); }

.arch-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--blue);
}

.arch-chevron {
  width: 16px;
  height: 16px;
  color: var(--blue);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.arch-card.arch-collapsed .arch-chevron { transform: rotate(-90deg); }

.arch-body {
  padding: 16px 20px 12px;
}

.arch-card.arch-collapsed .arch-body { display: none; }

.arch-body svg { display: block; width: 100%; height: auto; }

/* ── Interactive architecture flow diagrams ─────────────────────────────── */
.arch-flow-note {
  font-size: .72em;
  color: var(--mid);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.5;
}
.arch-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 2px 0 4px;
}
.anode-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}
.anode {
  flex: 1;
  min-width: 120px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--white);
  position: relative;
}
.anode.has-script { cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .1s; }
.anode.has-script:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,100,202,.1); transform: translateY(-1px); }
.anode.arch-active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,100,202,.18); }
.anode-blue   { border-color: #0B64CA; background: rgba(11,100,202,.07); }
.anode-teal   { border-color: #00BFB3; background: rgba(0,191,179,.07); }
.anode-orange { border-color: #FE5B08; background: rgba(254,91,8,.07); }
.anode-green  { border-color: #54B399; background: rgba(84,179,153,.07); }
.anode-gray   { border-color: var(--border); background: rgba(52,55,65,.05); }
.anode-label  { font-size: .79em; font-weight: 700; color: var(--dark); line-height: 1.3; }
.anode-sub    { font-size: .69em; color: var(--mid); margin-top: 3px; line-height: 1.4; }
.anode-badge  {
  display: inline-block; margin-top: 5px;
  font-size: .63em; font-weight: 600;
  color: #017D73; background: rgba(84,179,153,.15);
  border-radius: 4px; padding: 1px 5px;
}
.anode-hint {
  font-size: .62em; color: var(--blue);
  margin-top: 5px; opacity: .85;
}
.anode-hint::before { content: '⬡ '; }
.aflow-arr {
  flex: 0 0 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal); font-size: 1.1em;
  align-self: center;
}
/* Script reveal panel */
.arch-script-panel {
  margin-top: 10px;
  background: #0F1C38;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  overflow: hidden;
  animation: archFadeIn .15s ease;
}
.arch-script-panel-hdr {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.arch-script-title {
  font-size: .72em; font-weight: 700;
  color: #00BFB3;
  font-family: 'JetBrains Mono', monospace;
}
.arch-script-btns { display: flex; gap: 6px; }
.arch-script-btn {
  background: rgba(255,255,255,.1); border: none;
  border-radius: 4px; color: #c8dff8;
  font-size: .67em; padding: 3px 8px;
  cursor: pointer; font-family: inherit;
}
.arch-script-btn:hover { background: rgba(255,255,255,.2); }
.arch-script-panel pre {
  margin: 0; padding: 12px 14px;
  font-size: .73em; color: #c8dff8;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.55; white-space: pre;
}
@keyframes archFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Utility ──────────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .step-main { margin-left: 0; }
  .step-header { padding: 20px 24px 16px; }
  .step-content { padding: 28px 24px; }
  .step-nav { padding: 20px 24px 32px; }
  .steps-section { padding: 28px 20px 40px; }
  .home-hero { padding: 36px 20px 32px; }
  .home-title { font-size: 26px; }
  .step-nav-btn { min-width: auto; }
}

@media (max-width: 600px) {
  .steps-grid { grid-template-columns: 1fr; }
  .step-nav { flex-direction: column; }
  .step-nav-btn { width: 100%; justify-content: center !important; }
  .step-nav-btn-next { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Sidebar collapse + Kibana split-pane
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Sidebar top bar ──────────────────────────────────────────────────── */
.sidebar-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 10px;
  gap: 8px;
}

/* ── Sidebar toggle button ────────────────────────────────────────────── */
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--mid);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-toggle-btn:hover {
  background: var(--blue-light);
  color: var(--blue);
  border-color: var(--blue);
}

/* Chevron direction swap */
.sidebar-toggle-btn .icon-collapse { display: block; }
.sidebar-toggle-btn .icon-expand   { display: none; }
.step-layout.sidebar-collapsed .sidebar-toggle-btn .icon-collapse { display: none; }
.step-layout.sidebar-collapsed .sidebar-toggle-btn .icon-expand   { display: block; }

/* ── Sidebar step text span ───────────────────────────────────────────── */
.sidebar-step-text {
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

/* ── Sidebar collapsed state ──────────────────────────────────────────── */
.step-layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}

.step-layout.sidebar-collapsed .step-main {
  margin-left: var(--sidebar-collapsed-w);
}

.step-layout.sidebar-collapsed .sidebar-top-bar {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.step-layout.sidebar-collapsed .sidebar-label {
  max-width: 0;
  opacity: 0;
}

.step-layout.sidebar-collapsed .sidebar-step-text {
  max-width: 0;
  opacity: 0;
}

.step-layout.sidebar-collapsed .sidebar-step-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* ── Kibana toggle button (in step header) ────────────────────────────── */
.btn-kibana-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s;
}

.btn-kibana-toggle:hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(11,100,202,.3);
}

.step-layout.kibana-open .btn-kibana-toggle {
  background: var(--mid);
}

.step-layout.kibana-open .btn-kibana-toggle:hover {
  background: var(--dark);
  box-shadow: none;
}

/* Button label swap */
.btn-kibana-toggle .kibana-btn-open  { display: inline; }
.btn-kibana-toggle .kibana-btn-close { display: none; }
.step-layout.kibana-open .btn-kibana-toggle .kibana-btn-open  { display: none; }
.step-layout.kibana-open .btn-kibana-toggle .kibana-btn-close { display: inline; }

/* ── Kibana split pane (iframe mode) ─────────────────────────────────── */
.kibana-pane {
  display: none;
  position: fixed;
  right: 0;
  top: var(--nav-h);
  bottom: 0;
  width: var(--kibana-pane-w);
  background: var(--dark-2);
  border-left: 1px solid rgba(255,255,255,.08);
  flex-direction: column;
  z-index: 5;
  box-shadow: -6px 0 32px rgba(0,0,0,.18);
}

.step-layout.kibana-open .kibana-pane {
  display: flex;
}

.step-layout.kibana-open .step-main {
  margin-right: var(--kibana-pane-w);
}

/* Kibana pane header bar */
.kibana-pane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 42px;
  flex-shrink: 0;
  background: var(--dark-2);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.kibana-pane-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  flex: 1;
}

.kibana-newtab-link {
  display: flex;
  align-items: center;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  padding: 2px;
  border-radius: 3px;
  transition: color .12s;
}
.kibana-newtab-link:hover { color: rgba(255,255,255,.8); }

.kibana-reload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.kibana-reload-btn:hover { background: rgba(255,255,255,.1); color: var(--white); }

/* iframe itself */
.kibana-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--white);
}

/* Loading state */
.kibana-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255,255,255,.5);
  font-size: .8em;
}

.kibana-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: kbSpin .7s linear infinite;
}
@keyframes kbSpin { to { transform: rotate(360deg); } }

.kibana-loading-text { color: rgba(255,255,255,.5); font-size: .8em; }

/* Idle placeholder */
.kibana-idle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.kibana-idle-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  max-width: 220px;
}
.kibana-idle-text {
  font-size: .8em;
  color: rgba(255,255,255,.4);
  line-height: 1.5;
}

/* Auth overlay — shown when login required */
.kibana-auth-overlay {
  position: absolute;
  inset: 42px 0 0 0; /* below header */
  background: rgba(25,27,34,.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}
.kibana-auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 280px;
  text-align: center;
}
.kibana-auth-icon { margin-bottom: 4px; }
.kibana-auth-heading {
  font-size: 1em;
  font-weight: 700;
  color: var(--white);
}
.kibana-auth-sub {
  font-size: .77em;
  color: rgba(255,255,255,.5);
  line-height: 1.5;
  margin-bottom: 4px;
}

/* Credentials inside auth overlay */
.kibana-auth-creds {
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 12px 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.kibana-auth-cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kibana-cred-label {
  font-size: .72em;
  color: rgba(255,255,255,.4);
  font-weight: 500;
}
.kibana-cred-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78em;
  color: #00BFB3;
  background: rgba(0,191,179,.1);
  border-radius: 4px;
  padding: 2px 8px;
}

.kibana-auth-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kibana-auth-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .75em;
  color: rgba(255,255,255,.55);
}
.kibana-auth-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  font-size: .72em;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  flex-shrink: 0;
}

.kibana-login-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: var(--blue);
  color: var(--white);
  border-radius: var(--radius);
  font-size: .82em;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background .12s;
}
.kibana-login-btn:hover { background: var(--blue-dark); }

.kibana-after-login-btn {
  width: 100%;
  padding: 9px 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  color: rgba(255,255,255,.7);
  font-size: .8em;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s;
}
.kibana-after-login-btn:hover { background: rgba(255,255,255,.13); color: var(--white); }

/* ── Demo-peek: hover-to-preview chips ───────────────────────────────────── */
.demo-peek {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 5px;
  font-size: .82em;
  font-weight: 500;
  text-decoration: none;
  cursor: default;
  background: rgba(11,100,202,.07);
  border: 1px solid rgba(11,100,202,.25);
  color: var(--blue);
  user-select: none;
  white-space: nowrap;
  transition: background .15s;
  vertical-align: middle;
}
.demo-peek:hover { background: rgba(11,100,202,.14); }
.demo-peek svg { flex-shrink: 0; }

.demo-peek-popup {
  position: fixed;
  z-index: 10000;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: min(780px, 92vw);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s;
}
.demo-peek-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.demo-peek-popup img {
  display: block;
  width: 100%;
  border-bottom: 1px solid var(--border);
}
.demo-peek-popup-caption {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.demo-peek-popup-copy { padding: 14px 16px; }
.demo-peek-popup-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.demo-peek-popup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
}
.demo-peek-popup-url {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  word-break: break-all;
  color: var(--dark);
}
.demo-peek-copy-btn {
  flex-shrink: 0;
  padding: 5px 14px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.demo-peek-copy-btn:hover { background: var(--blue-dark); }

/* ── demo-peek code popup ──────────────────────────────────────────────────── */
.demo-peek-popup-code-wrap { display: flex; flex-direction: column; max-height: 480px; }
.demo-peek-popup-code-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.demo-peek-code-pre {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  line-height: 1.6;
  color: #d4d4d4;
  background: #1e1e2e;
  white-space: pre;
  tab-size: 4;
}

/* ── Kibana auto-links in markdown body ──────────────────────────────────── */
.kibana-auto-link {
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}
.kibana-auto-link::after {
  content: ' ↗';
  font-size: .85em;
  opacity: .7;
}
