:root{
  --bg: #ffffff;
  --text: #595959;
  --muted: #777777;
  --link: #39c;
  --link-hover: #069;
  --header-bg: #f4f4f4;
  --panel-bg: #f8f8f8;
  --border: #e5e5e5;
  --code-bg: #f8f8f8;
  --code-text: #333;
  --accent: #39c;
}

[data-theme="dark"]{
  --bg: #0f1113;
  --text: #d6d6d6;
  --muted: #9aa0a6;
  --link: #6fb3ff;
  --link-hover: #9ed1ff;
  --header-bg: #0d0f11;
  --panel-bg: #111213;
  --border: #222427;
  --code-bg: #0b0c0d;
  --code-text: #e6eef8;
  --accent: #6fb3ff;
}

body {
  background-color: var(--bg);
  padding:50px;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color:var(--text);
  font-weight:400;
  transition: background-color 240ms ease, color 240ms ease;
}

h1, h2, h3, h4, h5, h6 {
  color:#222;
  margin:0 0 20px;
}

p, ul, ol, table, pre, dl {
  margin:0 0 20px;
}

h1, h2, h3 {
  line-height:1.1;
}

h1 {
  font-size:28px;
  font-weight: 500;
}

h2 {
  color:#393939;
  font-weight: 500;
}

h3, h4, h5, h6 {
  color:#494949;
  font-weight: 500;
}

a {
  color:var(--link);
  text-decoration:none;
}

a:hover {
  color:var(--link-hover);
}

a small {
  font-size:11px;
  color:#777;
  margin-top:-0.3em;
  display:block;
}

a:hover small {
  color:#777;
}

.wrapper {
  width:860px;
  margin:0 auto;
}

blockquote {
  border-left:1px solid var(--border);
  margin:0;
  padding:0 0 0 20px;
  font-style:italic;
}

code, pre {
  font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, Consolas, Liberation Mono, DejaVu Sans Mono, Courier New, monospace;
  color:var(--code-text);
}

pre {
  padding:8px 15px;
  background: var(--code-bg);
  border-radius:5px;
  border:1px solid var(--border);
  overflow-x: auto;
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease;
}

table {
  width:100%;
  border-collapse:collapse;
}

th, td {
  text-align:left;
  padding:5px 10px;
  border-bottom:1px solid #e5e5e5;
}

dt {
  color:#444;
  font-weight:500;
}

th {
  color:#444;
}

img {
  max-width:100%;
}

header {
  width:270px;
  float:left;
  position:fixed;
  -webkit-font-smoothing:subpixel-antialiased;
}

header ul {
  list-style:none;
  height:40px;
  padding:0;
  background: var(--header-bg);
  border-radius:5px;
  border:1px solid #e0e0e0;
  width:270px;
}

header li {
  width:89px;
  float:left;
  border-right:1px solid #e0e0e0;
  height:40px;
}

header li:first-child a {
  border-radius:5px 0 0 5px;
}

header li:last-child a {
  border-radius:0 5px 5px 0;
}

header ul a {
  line-height:1;
  font-size:11px;
  color:#999;
  display:block;
  text-align:center;
  padding-top:6px;
  height:34px;
}


/* Compact emoji theme toggle placed inline with the h1 */
.theme-emoji {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: transparent;
  border: none;
  color: var(--text);
  padding:0;
  margin-left:0.55rem; /* move SVG slightly further from title */
  width:28px;
  height:28px;
  border-radius:6px;
  font-size:16px;
  line-height:1;
  cursor:pointer;
  transition: background-color 160ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.theme-emoji:hover {
  background: rgba(0,0,0,0.04);
  transform: scale(1.06);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Slight vertical nudge for inline icons to better match the heading baseline */
.theme-icon {
  display:inline-block;
  transform: translateY(-1px);
}

/* Position the toggle to the right edge of the header on wide screens */
header {
  position: fixed;
}

header > .theme-emoji {
  position: absolute;
  top: 10px;
  right: 14px;
}

.theme-emoji:focus {
  outline: 3px solid rgba(63,114,255,0.16);
  outline-offset: 2px;
}

.theme-emoji[aria-pressed="true"] {
  transform: rotate(12deg);
}

/* Respect user's preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .theme-emoji,
  .theme-emoji:hover,
  .theme-emoji[aria-pressed="true"] {
    transition: none !important;
    transform: none !important;
  }
}

.theme-toggle .sr-only { 
  position: absolute; 
  width: 1px; 
  height: 1px; 
  padding: 0; 
  margin: -1px; 
  overflow: hidden; 
  clip: rect(0,0,0,0); 
  white-space: nowrap; 
  border: 0; 
}

header ul a:hover {
  color:#999;
}

header ul a:active {
  background-color:#f0f0f0;
}

strong {
  color:#222;
  font-weight:500;
}

header ul li + li + li {
  border-right:none;
  width:89px;
}

header ul a strong {
  font-size:14px;
  display:block;
  color:#222;
}

section {
  width:500px;
  float:right;
  padding-bottom:50px;
}

small {
  font-size:11px;
}

hr {
  border:0;
  background:#e5e5e5;
  height:1px;
  margin:0 0 20px;
}

footer {
  width:270px;
  float:left;
  position:fixed;
  bottom:50px;
  -webkit-font-smoothing:subpixel-antialiased;
}

@media print, screen and (max-width: 960px) {

  div.wrapper {
    width:auto;
    margin:0;
  }

  header, section, footer {
    float:none;
    position:static;
    width:auto;
  }

  header {
    padding-right:320px;
    position: static;
  }

  section {
    border:1px solid #e5e5e5;
    border-width:1px 0;
    padding:20px 0;
    margin:0 0 20px;
  }

  header a small {
    display:inline;
  }

  header ul {
    position:absolute;
    right:50px;
    top:52px;
  }

  /* On narrower screens let the toggle flow inline near the top of the header */
  header > .theme-emoji {
    position: static;
    margin-left: 0;
    display:inline-flex;
    vertical-align: middle;
  }
}

@media print, screen and (max-width: 720px) {
  body {
    word-wrap:break-word;
  }

  header {
    padding:0;
  }

  header ul, header p.view {
    position:static;
  }

  pre, code {
    word-wrap:normal;
  }
}

@media print, screen and (max-width: 480px) {
  body {
    padding:15px;
  }

  header ul {
    width:99%;
  }

  header li, header ul li + li + li {
    width:33%;
  }
}

@media print {
  body {
    padding:0.4in;
    font-size:12pt;
    color:#444;
  }
}

/* Inline vector artwork that replaces ASCII art */
.ascii-art {
  margin: 0 0 18px;
  width: 100%;
  max-width: 420px;
}

.inline-art {
  display: block;
  color: var(--muted);
  stroke: currentColor;
  max-width: 100%;
  height: auto;
}

.ascii-art .sr-only { 
  position: absolute; 
  width: 1px; 
  height: 1px; 
  padding: 0; 
  margin: -1px; 
  overflow: hidden; 
  clip: rect(0,0,0,0); 
  white-space: nowrap; 
  border: 0; 
}

/* Properly styled ASCII-art container */
.ascii-art pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--code-bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: Monaco, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.08;
  white-space: pre;
  overflow: auto;
}

