/* Finance handbook site. Plain CSS, no external fonts or scripts, so the site works offline
   and from any file share. Change the two colors below to match your brand. */
:root {
  --accent: #1f5f7a;
  --accent-soft: #e6f2f7;
  --ink: #1d2327;
  --ink-soft: #55606a;
  --line: #dde3e8;
  --bg: #ffffff;
  --panel: #f6f8fa;
  --flag: #fff3d6;
  --flag-ink: #7a5300;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7cc4e0;
    --accent-soft: #1b2d36;
    --ink: #e7ecef;
    --ink-soft: #a7b2bb;
    --line: #2c353c;
    --bg: #121619;
    --panel: #181e22;
    --flag: #3a2f12;
    --flag-ink: #f2cf7a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.6; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--panel); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--panel); padding: 1rem; border-radius: 8px; overflow-x: auto; }
pre code { background: none; padding: 0; }

.topbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.55rem; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.sidebar { border-right: 1px solid var(--line); padding: 1.5rem 1rem; position: sticky; top: 3.4rem; align-self: start; max-height: calc(100vh - 3.4rem); overflow-y: auto; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0.1rem 0; }
.sidebar a { display: block; padding: 0.35rem 0.7rem; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.sidebar a:hover { background: var(--panel); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .group { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin: 1.1rem 0.7rem 0.35rem; }

.content { padding: 2rem 2.5rem 3rem; max-width: 52rem; }
.content h1 { font-size: 2rem; line-height: 1.2; margin: 0.2rem 0 1rem; }
.content h2 { font-size: 1.3rem; margin-top: 2.2rem; padding-top: 0.4rem; border-top: 1px solid var(--line); }
.content h3 { font-size: 1.05rem; margin-top: 1.6rem; }
.meta { color: var(--ink-soft); font-size: 0.85rem; margin: 0; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.92rem; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 0.5rem 0.65rem; text-align: left; vertical-align: top; }
th { background: var(--panel); font-weight: 600; }
blockquote { margin: 1rem 0; padding: 0.6rem 1rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; }
blockquote p { margin: 0.3rem 0; }

.placeholder { background: var(--flag); color: var(--flag-ink); padding: 0.05em 0.35em; border-radius: 4px; font-size: 0.92em; }

.footer { border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.82rem; padding: 1.2rem 1.5rem; text-align: center; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 1rem; }
  .content { padding: 1.5rem 1rem 2.5rem; }
}
