/* Guide page */
.guide-hero {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.guide-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.guide-hero p {
  margin: 0;
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.guide-shell {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.guide-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.guide-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--surface);
}

.guide-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.guide-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.guide-search {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.guide-search:focus {
  border-color: rgba(103, 232, 249, 0.4);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.08);
}

.guide-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 520px;
}

.guide-nav {
  padding: 14px 10px;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  position: sticky;
  top: calc(var(--nav-h) + 8px);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 24px);
  overflow-y: auto;
}

.guide-nav::-webkit-scrollbar { width: 4px; }
.guide-nav::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.guide-nav .nav-group {
  padding: 10px 10px 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.guide-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.guide-nav button::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.5;
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
}

.guide-nav button:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.guide-nav button.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(103, 232, 249, 0.08));
  border-color: rgba(167, 139, 250, 0.25);
}

.guide-nav button.active::before {
  background: var(--accent-cyan);
  opacity: 1;
  box-shadow: 0 0 8px rgba(103, 232, 249, 0.5);
}

.guide-content {
  padding: 24px;
}

.guide-panel {
  display: none;
  animation: panelIn 0.45s var(--ease);
}

.guide-panel.active { display: block; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.guide-panel-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.guide-panel h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.guide-panel .lead {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 68ch;
}

.guide-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.65;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.guide-steps li:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.guide-steps li b {
  display: block;
  margin-bottom: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.guide-tip {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-cyan);
  background: rgba(103, 232, 249, 0.06);
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.guide-tip.warn {
  border-left-color: #f472b6;
  background: rgba(244, 114, 182, 0.06);
}

.guide-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.guide-table th,
.guide-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.guide-table th {
  background: rgba(0, 0, 0, 0.3);
  font-weight: 700;
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.guide-table td { color: var(--text-secondary); }
.guide-table tr:last-child td { border-bottom: none; }

code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  color: var(--accent-cyan);
}

.guide-hidden { display: none !important; }

@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-nav {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 12px;
  }
  .guide-nav::-webkit-scrollbar {
    display: none;
  }
  .guide-nav .nav-group { width: auto; padding-left: 0; flex-shrink: 0; }
  .guide-nav button {
    width: auto;
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
  }
}

/* ── Light theme (revenue sage) ── */
html[data-theme="light"] .guide-shell {
  background: linear-gradient(165deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-card);
}

html[data-theme="light"] .guide-toolbar {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

html[data-theme="light"] .guide-badge {
  background: var(--surface-3);
  border-color: var(--border);
  color: #3d7a4a;
}

html[data-theme="light"] .guide-search {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] .guide-nav {
  background: var(--surface-2);
  border-color: var(--border);
}

html[data-theme="light"] .guide-nav button:hover,
html[data-theme="light"] .guide-nav-link:hover {
  background: var(--surface-3);
}

html[data-theme="light"] .guide-nav button.active,
html[data-theme="light"] .guide-nav-link.active {
  background: rgba(176, 212, 184, 0.28);
  border-color: rgba(61, 122, 74, 0.32);
  color: var(--text);
}

html[data-theme="light"] .guide-content {
  background: var(--bg-elevated);
}

html[data-theme="light"] code {
  background: var(--surface-3);
  color: #3d7a4a;
  border-color: var(--border);
}
