/* HighAlch docs page. Beautiful UI supplies the tokens (--page, --canvas, --surface, --line,
   --ink, --ink-2, --ink-3, --hover-2, --accent) and the components; these rules lay out the page
   and its reading type with them, so it sits beside the watch page. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font-inter, Inter), system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

.docs-header {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px;
  height: 44px; padding: 0 16px; background: color-mix(in oklch, var(--page) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.docs-brand { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.docs-header-tab { font-size: 12.5px; color: var(--ink-3); }
.docs-live {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-size: 12.5px; font-weight: 500; color: var(--ink); text-decoration: none; transition: background-color 150ms;
}
.docs-live:hover { background: var(--hover-2); }
.docs-live-dot { width: 7px; height: 7px; border-radius: 50%; background: oklch(63% .2 25); box-shadow: 0 0 0 3px oklch(63% .2 25 / .2); }

.docs-body { display: grid; grid-template-columns: 232px minmax(0, 680px); justify-content: center; max-width: 1000px; margin: 0 auto; gap: 40px; padding: 0 24px; }

/* Section rail */
.docs-rail { position: sticky; top: 44px; align-self: start; max-height: calc(100vh - 44px); overflow-y: auto; padding: 28px 0 40px; display: flex; flex-direction: column; gap: 20px; }
.docs-rail-group { display: flex; flex-direction: column; gap: 4px; }
.docs-rail-label { padding: 0 10px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.docs-rail-list { position: relative; display: flex; flex-direction: column; gap: 1px; }
.docs-rail-list > [aria-hidden] { left: 0; right: 0; }
.docs-rail-item {
  position: relative; z-index: 1; display: block; padding: 6px 10px; border-radius: 7px;
  font-size: 13px; color: var(--ink-2); text-decoration: none; transition: color 150ms;
}
.docs-rail-item:hover { color: var(--ink); }
.docs-rail-item.is-active { color: var(--ink); font-weight: 500; background: var(--canvas); box-shadow: 0 0 0 1px var(--line); }

/* Content */
.docs-main { min-width: 0; max-width: 680px; padding: 40px 0 120px; }
.docs-hero { padding: 16px 0 36px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.docs-eyebrow { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; background: var(--accent-tint); color: var(--accent-ink); font-size: 12px; font-weight: 500; }
.docs-hero h1 { margin: 14px 0 10px; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
.docs-hero p { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.docs-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.docs-button {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 9px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--ink);
  font-size: 13.5px; font-weight: 500; text-decoration: none; transition: background-color 150ms, transform 150ms;
}
.docs-button:hover { background: var(--hover-2); }
.docs-button:active { transform: scale(0.98); }
.docs-button.is-primary { background: var(--ink); color: var(--page); box-shadow: none; }
.docs-button.is-primary:hover { background: color-mix(in oklch, var(--ink) 88%, var(--page)); }

.docs-section { padding-top: 36px; scroll-margin-top: 56px; }
.docs-section-group { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.docs-section h2 { margin: 4px 0 12px; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 600; }
.docs-section h2 a { color: inherit; text-decoration: none; }
.docs-section h2 a:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }

.docs-prose { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.docs-prose p { margin: 0 0 14px; text-wrap: pretty; }
.docs-prose strong { color: var(--ink); font-weight: 600; }
.docs-prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.docs-prose h3 { margin: 22px 0 6px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.docs-prose ul { margin: 0 0 14px; padding-left: 20px; }
.docs-prose li { margin: 6px 0; }
.docs-prose li::marker { color: var(--ink-3); }
.docs-component { margin: 16px 0 18px; }

/* Steps: TaskRows' capsule look (bg-surface + shadow-card come from Beautiful UI) */
.docs-steps { list-style: none; margin: 16px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.docs-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; }
.docs-step-num {
  display: inline-flex; flex-shrink: 0; width: 24px; height: 24px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent-tint); color: var(--accent-ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.docs-step-body { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.docs-step-label { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.docs-step-text { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }

/* Milestone table */
.docs-table { margin: 14px 0 16px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.docs-table-row { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; padding: 11px 14px; align-items: baseline; }
.docs-table-row + .docs-table-row { border-top: 1px solid var(--line); }
.docs-table-name { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.docs-table-what { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.docs-skill { image-rendering: pixelated; flex-shrink: 0; }

/* Three-column rows (name · weight · reward) and the formula card */
.docs-table.is-3 .docs-table-row { grid-template-columns: minmax(0, 1fr) 120px 120px; }
.docs-table-num { font-size: 13.5px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.docs-table.is-3 .docs-table-what { text-align: right; font-variant-numeric: tabular-nums; }
.docs-formula {
  display: flex; flex-direction: column; gap: 6px; margin: 14px 0 16px; padding: 14px 16px; border-radius: 12px;
  background: var(--canvas); box-shadow: 0 0 0 1px var(--line); font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.55; color: var(--ink-2);
}
.docs-formula b { color: var(--accent-ink); font-weight: 500; }

/* FAQ */
.docs-faq { margin: 8px 0 20px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.docs-faq details + details { border-top: 1px solid var(--line); }
.docs-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px;
  font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; list-style: none; transition: background-color 150ms;
}
.docs-faq summary::-webkit-details-marker { display: none; }
.docs-faq summary::after { content: "+"; font-size: 16px; color: var(--ink-3); transition: transform 200ms; }
.docs-faq details[open] summary::after { transform: rotate(45deg); }
.docs-faq summary:hover { background: var(--hover); }
.docs-faq details p { margin: 0; padding: 0 14px 14px; font-size: 14px; }
.docs-signoff { font-style: italic; color: var(--ink-3); }

@media (max-width: 860px) {
  .docs-body { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; }
  .docs-rail {
    position: sticky; top: 44px; z-index: 5; flex-direction: row; gap: 0; max-height: none; overflow-x: auto;
    padding: 8px 0; margin: 0 -16px; padding-inline: 12px; background: var(--page); border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .docs-rail-group { flex-direction: row; align-items: center; }
  .docs-rail-label { display: none; }
  .docs-rail-list { flex-direction: row; }
  .docs-rail-list > [aria-hidden] { display: none; }
  .docs-rail-item { white-space: nowrap; font-size: 12.5px; }
  .docs-main { padding-top: 20px; }
  .docs-hero h1 { font-size: 27px; }
  .docs-section { scroll-margin-top: 104px; }
  .docs-table-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .docs-table.is-3 .docs-table-row { grid-template-columns: minmax(0, 1fr) auto; }
  .docs-table.is-3 .docs-table-what { display: none; }
}

/* Match the existing native spectator palette and square RuneScape bevels. */
:root { --page:#181714; --canvas:#34362b; --surface:#3c3e31; --line:#66614f; --line-strong:#92876b; --ink:#f1e6c7; --ink-2:#dfd3b3; --ink-3:#bbb296; --hover-2:#4e5140; --accent:#ffcb62; --accent-ink:#ffdc7d; --accent-tint:#36382c; }
.docs-header { background:#292720; backdrop-filter:none; }
.docs-brand { display:inline-flex; align-items:center; gap:8px; color:#ffcb62; text-shadow:1px 1px #000; }
.docs-brand img { image-rendering:pixelated; }
.docs-live,.docs-button { border-radius:0; border:2px solid; border-color:#83806a #27291f #27291f #83806a; box-shadow:none; color:#ffdc7d; }
.docs-live { min-height:32px; }
.docs-live-dot { border-radius:0; background:#c7ac60; box-shadow:none; }
.docs-eyebrow { padding:0; border-radius:0; background:none; color:#cfc5aa; }
.docs-hero h1,.docs-section h2 { color:#ffcb62; text-shadow:1px 1px #000; }
.docs-button { min-height:40px; }
.docs-button.is-primary { background:#454638; color:#ffdc7d; border:2px solid; border-color:#92876b #27291f #27291f #92876b; }
.docs-button.is-primary:hover { background:#4e5140; }
.docs-button:active { transform:scale(.96); }
.docs-rail-item,.docs-table,.docs-step { border-radius:0; }
.docs-prose { font-size:1rem; line-height:1.65; }
.docs-prose ol { padding-left:22px; }
.docs-faq details { padding:12px 0; border-bottom:1px solid var(--line); }
.docs-faq summary { cursor:pointer; color:#ffdc7d; font-size:1rem; line-height:1.5; }
.docs-faq p { margin:10px 0 0; }
.docs a:focus-visible,.docs summary:focus-visible { outline:2px solid #ffcb62; outline-offset:3px; }
