/* The SpudSuite help site, in the app's Sideroom clothes: the same tokens as apps/web/src/styles.css
   (warm paper, warm charcoal, one plum accent; IBM Plex Sans, Reddit Sans, Fraunces, JetBrains Mono). */

:root {
  --bg: #f6f3ee; --surface: #fffefb; --surface-2: #f1ece5; --surface-3: #e8e2d9; --sidebar: #f1ece5;
  --ink: #1d1a16; --ink-2: #5a5247; --ink-3: #8c8478; --line: #e6e0d7; --line-strong: #d8cdbd;
  --accent: #7b2f91; --accent-hover: #67237b; --accent-on: #fdf8ff; --accent-soft: #f1e2f3; --accent-ink: #6c2381;
  --live: #1e9a5f; --live-soft: #d9f2e5; --butter: #c98a00; --butter-soft: #fbefd2; --butter-ink: #8a5d00;
  --sky: #3f7fbf; --sky-soft: #dde9f6; --danger: #c53a32; --danger-soft: #f8e1dc; --highlight: #fff1c2;
  --shadow-lg: 0 2px 6px rgb(40 28 12 / 0.06), 0 24px 60px -20px rgb(40 28 12 / 0.28);
  --radius: 12px; --radius-ctl: 10px;
  --font: "IBM Plex Sans Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --title: "Reddit Sans Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces Variable", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace;
  --top: 56px; --side: 268px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141210; --surface: #1b1916; --surface-2: #24211d; --surface-3: #2e2a25; --sidebar: #181613;
    --ink: #f4eee5; --ink-2: #c2b8aa; --ink-3: #8d8477; --line: #2d2a25; --line-strong: #3d362e;
    --accent: #c385dc; --accent-hover: #d39de8; --accent-on: #1c0d22; --accent-soft: #33203b; --accent-ink: #dcaaee;
    --live: #3ccf87; --live-soft: #173626; --butter: #f0bd45; --butter-soft: #3a2f16; --butter-ink: #f5cf85;
    --sky: #7fb0e6; --sky-soft: #1b2a3b; --danger: #ff6b61; --danger-soft: #3b1d1b; --highlight: #3b3216;
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.3), 0 30px 70px -20px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141210; --surface: #1b1916; --surface-2: #24211d; --surface-3: #2e2a25; --sidebar: #181613;
  --ink: #f4eee5; --ink-2: #c2b8aa; --ink-3: #8d8477; --line: #2d2a25; --line-strong: #3d362e;
  --accent: #c385dc; --accent-hover: #d39de8; --accent-on: #1c0d22; --accent-soft: #33203b; --accent-ink: #dcaaee;
  --live: #3ccf87; --live-soft: #173626; --butter: #f0bd45; --butter-soft: #3a2f16; --butter-ink: #f5cf85;
  --sky: #7fb0e6; --sky-soft: #1b2a3b; --danger: #ff6b61; --danger-soft: #3b1d1b; --highlight: #3b3216;
  --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.3), 0 30px 70px -20px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* The top bar */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand .wordmark { font-family: var(--display); font-weight: 650; font-size: 20px; letter-spacing: -0.01em; }
.brand-help { font: 600 12px/1 var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 7px; border-radius: 99px; }
.spud { display: inline-flex; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-ctl); background: none; color: var(--ink-2); cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-toggle { display: none; }
.btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--radius-ctl); background: var(--accent); color: var(--accent-on); font-weight: 600; font-size: 14px; text-decoration: none; flex-shrink: 0; }
.btn:hover { background: var(--accent-hover); color: var(--accent-on); }

.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search input { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: var(--surface); color: var(--ink);
  font: 15px var(--font); padding: 0 34px 0 34px; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-icon { position: absolute; left: 11px; top: 11px; color: var(--ink-3); display: flex; }
.search-key { position: absolute; right: 8px; top: 8px; font: 12px var(--mono); color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }
.search input:focus ~ .search-key { display: none; }
.results { position: absolute; top: 44px; left: 0; right: 0; max-height: min(70vh, 520px); overflow: auto; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.result { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.result[aria-selected="true"], .result:hover { background: var(--accent-soft); color: var(--ink); }
.result-title { font-weight: 600; font-family: var(--title); }
.result-where { font-size: 12.5px; color: var(--ink-3); }
.result-text { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result mark { background: var(--highlight); color: inherit; border-radius: 3px; padding: 0 1px; }
.no-results { padding: 14px 10px; color: var(--ink-2); font-size: 14px; }

/* The sidebar and the page */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); overflow-y: auto; padding: 18px 12px 40px;
  border-right: 1px solid var(--line); background: var(--sidebar); font-size: 14.5px; }
.nav-home { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; margin-bottom: 8px; }
.nav-section { margin-bottom: 14px; }
.nav-heading { padding: 4px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.sidebar a:hover { background: var(--surface-3); color: var(--ink); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.main { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 48px; justify-content: center; padding: 36px 32px 80px; min-width: 0; }
.doc { min-width: 0; }
.eyebrow { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-ink); }
.doc h1 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 5vw, 42px); line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 14px; }
.doc h2 { font-family: var(--title); font-size: 24px; line-height: 1.25; margin: 40px 0 10px; letter-spacing: -0.005em; }
.doc h3 { font-family: var(--title); font-size: 18.5px; margin: 28px 0 6px; }
.doc h2, .doc h3 { position: relative; }
.anchor { position: absolute; left: -22px; color: var(--ink-3); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.doc > p:first-of-type { font-size: 18px; color: var(--ink-2); }
.doc p, .doc li { max-width: 72ch; }
.doc ul, .doc ol { padding-left: 24px; }
.doc li { margin: 4px 0; }
.doc li > p { margin: 4px 0; }
.doc strong { font-weight: 650; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
code { font: 0.88em var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; position: relative; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); font: 600 12px var(--font); cursor: pointer; }
.copy:hover { color: var(--ink); }
kbd { font: 12.5px var(--mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; background: var(--surface); }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
figure { margin: 20px 0 24px; }
figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(40 28 12 / 0.06); background: var(--surface); }
figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.callout { margin: 18px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.callout > :first-child { margin-top: 0; } .callout > :last-child { margin-bottom: 0; }
.callout-tip { background: var(--live-soft); border-color: color-mix(in srgb, var(--live) 30%, transparent); }
.callout-heads-up { background: var(--butter-soft); border-color: color-mix(in srgb, var(--butter) 35%, transparent); }
.callout-admins { background: var(--sky-soft); border-color: color-mix(in srgb, var(--sky) 30%, transparent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 28px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card:hover { border-color: var(--line-strong); }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card p { margin: 0 0 8px; color: var(--ink-2); font-size: 14.5px; }
.card ul { margin: 0; padding-left: 18px; font-size: 14px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--accent); }
.pager span { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.pager .next { text-align: right; grid-column: 2; }
.foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; }

.toc { position: sticky; top: calc(var(--top) + 24px); align-self: start; font-size: 13.5px; max-height: calc(100vh - var(--top) - 48px); overflow: auto; }
.toc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); margin-bottom: 6px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a.is-here { color: var(--accent-ink); border-left-color: var(--accent); }

@media (max-width: 1180px) { .main { grid-template-columns: minmax(0, 760px); } .toc { display: none; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-grid; }
  .sidebar { position: fixed; z-index: 40; top: var(--top); left: 0; bottom: 0; width: min(86vw, 320px); height: auto; transform: translateX(-105%); transition: transform 0.18s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: var(--top) 0 0 0; z-index: 35; background: rgb(20 14 8 / 0.35); }
  .main { padding: 24px 16px 64px; }
  .open-app, .brand-help { display: none; }
  .anchor { display: none; }
}
@media (max-width: 520px) {
  .top { gap: 6px; padding: 0 10px; }
  .brand .wordmark { display: none; }
  .search-key { display: none; }
  .search input { padding-right: 10px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media print { .top, .sidebar, .toc, .pager, .foot { display: none; } .layout, .main { display: block; padding: 0; } }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
