/* Lunaris docs - one stylesheet, light + dark */
:root {
  --bg: #fbfaf8; --panel: #f1efea; --text: #1d1c1a; --muted: #6a665e; --line: #dedad2;
  --accent: #3b5bdb; --code-bg: #ecebe6; --ok: #2b8a3e; --warn: #b8590d; --todo: #6741d9;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517; --panel: #1c1d21; --text: #e6e4df; --muted: #9a968d; --line: #2e3036;
    --accent: #8ea6ff; --code-bg: #24262b; --ok: #69db7c; --warn: #ffa94d; --todo: #b197fc;
  }
}
:root[data-theme="dark"] {
  --bg: #141517; --panel: #1c1d21; --text: #e6e4df; --muted: #9a968d; --line: #2e3036;
  --accent: #8ea6ff; --code-bg: #24262b; --ok: #69db7c; --warn: #ffa94d; --todo: #b197fc;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--accent); }
code, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 0.9rem 1rem; border-radius: 6px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; overflow-wrap: normal; }

.top { display: flex; align-items: baseline; gap: 1rem; padding: 0.9rem 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); letter-spacing: 0.02em; }
.tag { color: var(--muted); font-size: 0.9rem; }
.sections { margin-left: auto; display: flex; gap: 0.3rem; font-size: 0.9rem; }
.sections a { color: var(--muted); text-decoration: none; padding: 0.15rem 0.6rem; border-radius: 999px; }
.sections a:hover { color: var(--accent); }
.sections a[aria-current="true"] { color: var(--text); background: var(--panel); font-weight: 600; }
kbd { font-family: var(--mono); font-size: 0.82em; padding: 0.05em 0.4em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); white-space: nowrap; }
.steps { padding-left: 1.3rem; } .steps li { margin: 0.35rem 0; }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.side { border-right: 1px solid var(--line); padding: 1.5rem 1rem; position: sticky; top: 0; align-self: start; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 0.3rem 0.5rem; border-radius: 5px; text-decoration: none; color: var(--text); }
.side a:hover { background: var(--panel); }
.side a[aria-current="page"] { background: var(--panel); font-weight: 600; }
main { padding: 1.5rem 2rem 3rem; min-width: 0; }
article { max-width: 78ch; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.3rem; margin: 2.2rem 0 0.6rem; padding-top: 0.4rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
.lead { font-size: 1.08rem; color: var(--muted); }
.toc { background: var(--panel); border-radius: 6px; padding: 0.7rem 1rem; margin: 0 0 1.5rem; font-size: 0.92rem; }
.toc span { font-weight: 600; }
.toc ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }

table { border-collapse: collapse; width: 100%; margin: 0.8rem 0 1.2rem; font-size: 0.93rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel); font-weight: 600; }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 999px;
         border: 1px solid currentColor; white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.todo { color: var(--todo); }
.note { border-left: 3px solid var(--accent); background: var(--panel); padding: 0.6rem 1rem; border-radius: 0 6px 6px 0; margin: 1rem 0; }

.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.8rem; }
.cards li { background: var(--panel); border-radius: 8px; padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.cards a { font-weight: 600; text-decoration: none; }
.cards span { color: var(--muted); font-size: 0.9rem; }

.foot { margin-top: 3rem; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 0.6rem 16px; }
  .side ul { display: flex; flex-wrap: wrap; gap: 0.2rem; }
  main { padding: 1rem 16px 2rem; }
  .tag { display: none; }
}
