/* Real Budget's guides: the landing page's teal and mint, made for reading. */
:root {
  --teal: #1a464d;
  --teal-deep: #102e33;
  --mint: #6fd6c8;
  --mint-ink: #1e7f75;
  --mint-wash: #e6f4f1;
  --paper: #f7faf9;
  --card: #ffffff;
  --ink: #15262a;
  --ink-2: #4a5b5f;
  --ink-3: #6d7d80;
  --line: #dbe5e2;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bar: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar) + 20px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--mint-ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--mint); color: var(--teal-deep); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 10px; }
kbd { font: 600 0.82em var(--text); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--card); color: var(--ink); white-space: nowrap; }
code { font: 0.9em ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--mint-wash); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  height: var(--bar);
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(14px, 3vw, 32px);
  background: var(--teal-deep);
  color: #e6f2ef;
}
/* the shared header (chrome.css) with the guides' search in it */
.bar.site-bar { padding: 0 clamp(14px, 3vw, 32px); flex-wrap: nowrap; gap: 14px; min-height: 0; }
.bar .site-nav { margin-left: 4px; }
.side-site { display: none; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 38px; padding: 0 36px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 9px;
  background: rgba(255, 255, 255, 0.08); color: #fff; font: 15px var(--text);
}
.search input::placeholder { color: #9fc0ba; }
.search input:focus { background: #fff; color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--mint); }
.search .slash { position: absolute; right: 10px; top: 9px; background: transparent; color: #9fc0ba; border-color: rgba(255, 255, 255, 0.2); }
.search input:focus + .slash { display: none; }
.results {
  position: absolute; top: 44px; left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none;
  background: var(--card); color: var(--ink);
  border-radius: 12px; box-shadow: 0 24px 60px -16px rgba(16, 46, 51, 0.45), 0 0 0 1px var(--line);
  max-height: 70vh; overflow: auto;
}
.results a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.results a span { display: block; color: var(--ink-3); font-size: 14px; line-height: 1.4; }
.results a[aria-selected="true"], .results a:hover { background: var(--mint-wash); }
.results .none { padding: 10px 12px; color: var(--ink-3); }
.menu { display: none; }

/* ---------------------------------------------------------------- three columns */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 760px) 220px;
  justify-content: center;
  gap: clamp(24px, 3vw, 56px);
  padding: 0 clamp(14px, 3vw, 32px);
}
.side { position: sticky; top: var(--bar); align-self: start; max-height: calc(100vh - var(--bar)); overflow: auto; padding: 28px 0 40px; }
.side-group { margin-bottom: 22px; }
.side-title { margin: 0 0 6px; padding-left: 12px; font: 650 13.5px var(--text); color: var(--ink-3); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 5px 12px; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: 15.5px; line-height: 1.4; }
.side a:hover { background: var(--mint-wash); color: var(--ink); }
.side a[aria-current="page"] { background: var(--mint-wash); color: var(--teal-deep); font-weight: 650; box-shadow: inset 3px 0 0 var(--mint-ink); }
.toc { position: sticky; top: var(--bar); align-self: start; padding: 40px 0; font-size: 14.5px; }
.toc p { margin: 0 0 8px; font-weight: 650; color: var(--ink-3); font-size: 13.5px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-3); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--mint-ink); border-left-color: var(--mint-ink); font-weight: 600; }

/* ---------------------------------------------------------------- the guide */
main { padding: 34px 0 72px; min-width: 0; }
.crumb { margin: 0 0 10px; font-size: 14.5px; color: var(--ink-3); }
.crumb a { color: var(--ink-3); }
h1 { font: 700 clamp(32px, 4vw, 44px)/1.1 var(--display); letter-spacing: -0.02em; margin: 0 0 14px; text-wrap: balance; }
.summary { font-size: 19.5px; line-height: 1.55; color: var(--ink-2); margin: 0 0 30px; }
.guide h2 { font: 700 25px/1.25 var(--display); letter-spacing: -0.01em; margin: 46px 0 12px; padding-top: 26px; border-top: 1px solid var(--line); }
.guide h3 { font: 650 19px/1.3 var(--display); margin: 28px 0 8px; }
.guide p, .guide li { max-width: 68ch; }
.guide ul, .guide ol { padding-left: 1.3em; }
.guide li { margin-bottom: 6px; }
.guide li::marker { color: var(--mint-ink); }
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 14px; min-height: 30px; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal); color: #fff; font: 650 14px var(--display);
}
figure { margin: 24px 0 28px; }
figure img { display: block; border-radius: 12px; box-shadow: 0 18px 44px -20px rgba(16, 46, 51, 0.45), 0 0 0 1px rgba(16, 46, 51, 0.08); background: var(--card); }
figcaption { margin-top: 10px; font-size: 14.5px; color: var(--ink-3); }
.note { margin: 22px 0; padding: 14px 18px; border-radius: 10px; background: var(--mint-wash); border-left: 4px solid var(--mint-ink); max-width: 68ch; }
.note strong { color: var(--teal-deep); }
.note.careful { background: #fdf3e7; border-left-color: #c77a1e; }
.note.careful strong { color: #7a4708; }
.table { overflow-x: auto; margin: 18px 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; color: var(--ink-2); background: #eef3f2; }

.see { margin-top: 48px; }
.see ul, .cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.see li, .cards li { max-width: none; margin: 0; }
.see a, .cards a {
  display: block; height: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.see a:hover, .cards a:hover { border-color: var(--mint-ink); transform: translateY(-1px); }
.see strong, .cards strong { display: block; font-family: var(--display); font-weight: 650; margin-bottom: 4px; }
.see span, .cards span { display: block; font-size: 14.5px; line-height: 1.45; color: var(--ink-3); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; text-decoration: none; font: 650 17px var(--display); color: var(--ink); max-width: 48%; }
.pager a span { font: 14px var(--text); color: var(--ink-3); }
.pager .next { text-align: right; margin-left: auto; }
.pager a:hover { color: var(--mint-ink); }

.home h1 { margin-top: 10px; }
.group h2 { font: 700 22px var(--display); margin: 38px 0 14px; }

.missing { max-width: 1200px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 32px); color: var(--ink-3); font-size: 15px; }
.missing + .site-foot { margin-top: 28px; }

/* ---------------------------------------------------------------- narrower */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
/* the site links move into the sidebar once the header is short of room */
@media (max-width: 1100px) {
  .bar .site-nav { display: none; }
  .side-site { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
  .side .side-site a { display: inline-block; padding: 5px 10px; font-size: 15px; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .bar .site-get, .bar .brand span, .search .slash { display: none; }
  .menu {
    display: inline-grid; place-items: center; width: 38px; height: 38px; margin-left: -6px;
    border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  }
  .menu span, .menu span::before, .menu span::after { display: block; width: 18px; height: 2px; background: #e6f2ef; border-radius: 1px; position: relative; content: ""; }
  .menu span::before { position: absolute; top: -6px; }
  .menu span::after { position: absolute; top: 6px; }
  .side {
    position: fixed; top: var(--bar); left: 0; bottom: 0; z-index: 9;
    width: min(320px, 86vw); max-height: none; align-self: stretch;
    padding: 20px 14px; background: var(--paper);
    box-shadow: 20px 0 60px -20px rgba(16, 46, 51, 0.4);
    transform: translateX(-105%); transition: transform 0.25s ease;
  }
  body.side-open .side { transform: none; }
  .search { max-width: none; }
}

/* ---------------------------------------------------------------- dark */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0f2226; --card: #142b30; --ink: #e6efed; --ink-2: #b4c6c3; --ink-3: #8ea4a0; --line: #23403f;
    --mint-ink: var(--mint); --mint-wash: #17363a;
  }
  th { background: #17333a; }
  .note.careful { background: #33270f; border-left-color: #e0a24f; }
  .note.careful strong { color: #f2c98d; }
  .side a[aria-current="page"] { color: #fff; }
  ol.steps > li::before { background: var(--mint); color: var(--teal-deep); }
}
@media (prefers-reduced-motion: reduce) {
  .side, .see a, .cards a { transition: none; }
}
