/* Guide pages (scripts/build-guides.mjs): the app's tokens (src/tokens.css), quiet chrome,
   one accent. Dark by default, light from the same st-theme choice or the system scheme. */
:root {
  --field: #141414;
  --panels: #1c1c1c;
  --text: #ffffff;
  --selected: #4c8dff;
  --panels-raised: color-mix(in srgb, var(--panels) 88%, var(--text));
  --hairline: color-mix(in srgb, var(--panels) 90%, var(--text));
  --muted: color-mix(in srgb, var(--text) 62%, var(--field));
  color-scheme: dark;
}
:root[data-theme="light"] {
  --field: #ffffff;
  --panels: #f1f1f4;
  --text: #000000;
  --selected: #2f6fe0;
  --panels-raised: color-mix(in srgb, var(--panels) 92%, var(--text));
  --hairline: color-mix(in srgb, var(--panels) 90%, var(--text));
  --muted: color-mix(in srgb, var(--text) 56%, var(--field));
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--field);
  color: var(--text);
  font: 16px/26px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--selected); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--selected); outline-offset: 3px; border-radius: 4px; }

.bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--field) 88%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--hairline);
}
.bar nav { display: flex; align-items: center; gap: 16px; font-size: 14px; font-weight: 600; }
.bar nav a:not(.pill) { color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--panels);
  color: var(--selected);
  font-size: 14px;
  font-weight: 700;
}
.pill.solid { background: var(--text); color: var(--field); }
.pill:hover { text-decoration: none; background: var(--panels-raised); }
.pill.solid:hover { background: var(--text); opacity: 0.9; }

.page { max-width: 720px; margin: 0 auto; padding: 32px 24px 16px; }
.page.wide { max-width: 960px; }
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 16px; }

h1 { margin: 0 0 8px; font-size: 34px; line-height: 40px; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h2 { margin: 40px 0 12px; font-size: 22px; line-height: 28px; font-weight: 700; text-wrap: balance; }
p { margin: 0 0 16px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.lead { font-size: 19px; line-height: 30px; color: color-mix(in srgb, var(--text) 86%, var(--field)); }
.note { color: var(--muted); font-size: 13px; line-height: 18px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin: 4px 0; }
b, strong { font-weight: 700; }

.table { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--hairline); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th, td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--hairline); }
th { color: var(--muted); font-weight: 600; background: var(--panels); }
tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }

.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 10px 0 0; color: color-mix(in srgb, var(--text) 82%, var(--field)); }

.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cards li { margin: 0; }
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 16px;
  border-radius: 8px;
  background: var(--panels);
  color: var(--text);
}
.card:hover { text-decoration: none; background: var(--panels-raised); }
.card strong { font-size: 16px; line-height: 22px; }
.card span:last-child { color: var(--muted); font-size: 14px; line-height: 20px; }
.kicker { color: var(--muted); font-size: 13px; line-height: 18px; }

.cta { max-width: 720px; margin: 48px auto 0; padding: 24px; border-radius: 8px; background: var(--panels); text-align: center; }
.cta h2 { margin-top: 0; }
.cta p:last-child { margin: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.foot {
  max-width: 960px;
  margin: 48px auto 0;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 14px;
}
.foot p { margin: 8px 0 0; max-width: 320px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 16px; max-width: 480px; }
.foot nav a { color: var(--text); }

@media (max-width: 560px) {
  .bar { padding: 10px 16px; }
  .bar nav a:not(.pill) { display: none; }
  .page { padding: 24px 16px 8px; }
  h1 { font-size: 28px; line-height: 34px; }
  .lead { font-size: 17px; line-height: 27px; }
  .cta, .foot { margin-left: 16px; margin-right: 16px; }
}
