/* The shared look of the X_eTaL-extensions live pages (web/shell);
   adapted from X_eTaL-demos' microscope.css, with this repo's red. */
:root {
  --bg: #fbfaf7; --fg: #1d1d1f; --muted: #5f6368; --card: #ffffff; --line: #e3e0d8; --off: #f3f1ec;
  --accent: #c92a2a; --accent-soft: #ffe3e3;
  --t-builtin: #1c5fd4; --t-user: #2b8a3e; --t-arg: #a61e8f; --t-num: #9c6500; --t-sym: #0b7285;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141518; --fg: #e8e6e3; --muted: #a0a4ab; --card: #1d1f23; --line: #30333a; --off: #26292f;
  --accent: #ff6b6b; --accent-soft: #3b1f22;
  --t-builtin: #8fb0ff; --t-user: #8ce99a; --t-arg: #f783ac; --t-num: #ffd43b; --t-sym: #66d9e8;
} }
:root[data-theme="dark"] {
  --bg: #141518; --fg: #e8e6e3; --muted: #a0a4ab; --card: #1d1f23; --line: #30333a; --off: #26292f;
  --accent: #ff6b6b; --accent-soft: #3b1f22;
  --t-builtin: #8fb0ff; --t-user: #8ce99a; --t-arg: #f783ac; --t-num: #ffd43b; --t-sym: #66d9e8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header, main, footer { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 { margin: 0; font-size: 1.7rem; }
.logo { height: 44px; width: auto; border-radius: 6px; display: block; }
.lede { color: var(--muted); margin: 8px 0 12px; max-width: 80ch; }
code, .source, .editor, .out, .error { font-family: "JuliaMono", "DejaVu Sans Mono", Menlo, ui-monospace, monospace; }
.t-builtin { color: var(--t-builtin); } .t-user { color: var(--t-user); } .t-arg { color: var(--t-arg); }
.t-num { color: var(--t-num); } .t-sym { color: var(--t-sym); }
.t-comment { color: var(--muted); font-style: italic; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.controls button { font: inherit; padding: 5px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.controls button:hover:not(:disabled) { border-color: var(--accent); }
.controls button:disabled { opacity: .5; cursor: default; }
.controls button.run { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.gen { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.panel h2 { font-size: 1rem; margin: 0 0 4px; }
.note { color: var(--muted); margin: 0 0 10px; font-size: .9rem; }
.editor { width: 100%; font-size: .9rem; line-height: 1.6; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px; background: var(--off); color: var(--fg); tab-size: 2; }
.editor:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.source, .out, .error { margin: 0; padding: 10px 12px; background: var(--off); border-radius: 8px; overflow: auto;
  white-space: pre-wrap; font-size: .9rem; line-height: 1.6; }
.error { color: #c92a2a; background: var(--accent-soft); }
.fns { border-collapse: collapse; width: 100%; font-size: .85rem; }
.fns td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.fns td.doc { color: var(--muted); }
footer { color: var(--muted); font-size: .85rem; padding-top: 18px; padding-bottom: 28px;
  margin-top: 20px; border-top: 1px solid var(--line); }
footer a { color: var(--accent); }
footer .sep { margin: 0 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  color: var(--fg); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--accent); }
.card p { margin: 0; color: var(--muted); }
.card p.how { margin-top: 8px; font-size: .85rem; color: var(--accent); }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .gen { margin-left: 0; width: 100%; }
}
main h2 { margin: 28px 0 4px; font-size: 1.3rem; }
main h2 a { color: var(--accent); text-decoration: none; }
.demos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 16px; }
.demo h3 { margin: 0 0 4px; font-size: 1rem; }
.demo video { width: 100%; border-radius: 8px; background: #000; display: block; margin-bottom: 8px; }
header pre.source { max-width: 80ch; }

/* the demos page: a table of contents at the top left (fixed beside
   the page when there is room, else at the top) */
nav.toc { font-size: 0.9rem; padding: 12px 16px; border-bottom: 1px solid var(--line); }
nav.toc p { margin: 0 0 6px; font-weight: 600; }
nav.toc ul { list-style: none; margin: 0; padding: 0; }
nav.toc ul ul { padding-left: 12px; margin: 2px 0 6px; }
nav.toc li { margin: 2px 0; }
nav.toc a { color: var(--fg); text-decoration: none; }
nav.toc ul ul a { color: var(--muted); }
nav.toc a:hover { color: var(--accent); }
section.demo, main h2 { scroll-margin-top: 12px; }
@media (min-width: 1100px) {
  body:has(nav.toc) { padding-left: 220px; }
  nav.toc { position: fixed; top: 0; left: 0; width: 220px; height: 100vh; box-sizing: border-box;
    overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--line); background: var(--bg); }
}
a.docs { font-size: 0.8rem; font-weight: normal; margin-left: 10px; color: var(--accent); }
nav.toc p.docs { font-weight: normal; margin-bottom: 10px; }
nav.toc p.docs a { color: var(--accent); }
