:root {
  color-scheme: dark;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  background: #101214;
  color: #e6e6e6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.layout {
  display: grid;
  grid-template-columns: minmax(17rem, 23rem) minmax(0, 54rem) minmax(14rem, 18rem);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 2.5rem;
  border-right: 1px solid #30363d;
  background: #0d0f11;
}

.site-name {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.75rem;
  color: #f2f2f2;
  font-size: 1.35rem;
  font-weight: 700;
}

.site-name img {
  width: 2.5rem;
  height: 2.5rem;
}

.greeting {
  margin: 2rem 0;
}

.greeting p {
  margin: 0;
  font-size: 0.9rem;
}

.note-nav {
  overflow-y: auto;
}

.note-nav::before {
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
  border-top: 1px solid #30363d;
  content: "";
}

.note-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-nav li + li {
  margin-top: 0.2rem;
}

.note-nav a {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 0.625rem;
  color: #a9b1ba;
  line-height: 1.4;
  transition: background-color 120ms ease, color 120ms ease;
}

.note-nav a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.note-nav a:hover,
.note-nav a:focus-visible {
  background: #191c20;
  color: #f2f2f2;
  text-decoration: none;
}

.note-nav a[aria-current="page"] {
  border-left: 3px solid #79c0ff;
  background: #20252b;
  color: #f2f2f2;
  font-weight: 600;
  text-decoration: none;
}

.elsewhere {
  display: flex;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.85rem;
}

.elsewhere-mobile {
  display: none;
}

.content {
  width: min(54rem, 100%);
  overflow-wrap: anywhere;
  padding: 4rem clamp(2rem, 3vw, 3rem) 6rem;
  color: #dcdcdc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

.content img {
  max-width: 100%;
  height: auto;
}

h1,
h2 {
  color: #f2f2f2;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.875rem, 5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

a {
  color: #79c0ff;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

code {
  font-family: "SF Mono", SFMono-Regular, ui-monospace, Consolas,
    "Liberation Mono", Menlo, monospace;
  color: #e6e6e6;
}

:not(pre) > code {
  padding: 0.12em 0.32em;
  border: 1px solid #343a40;
  border-radius: 0.3rem;
  background: #24282d;
  color: #f0f3f6;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.7;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-header time {
  display: block;
  color: #7d8590;
  font-size: 0.85rem;
}

.stats-table-wrap {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.stats-table th,
.stats-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #30363d;
  white-space: nowrap;
}

.stats-table th {
  color: #a9b1ba;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.stats-table td[colspan] {
  color: #7d8590;
  text-align: center;
}

.stats-table button,
.stats-actions button {
  padding: 0.35rem 0.65rem;
  border: 1px solid #30363d;
  border-radius: 0.35rem;
  background: #20252b;
  color: #f2f2f2;
  cursor: pointer;
  font: inherit;
}

.stats-table button:hover,
.stats-table button:focus-visible,
.stats-actions button:hover,
.stats-actions button:focus-visible {
  border-color: #79c0ff;
}

.stats-table button {
  margin-left: 0.75rem;
}

.stats-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  color: #d29922;
  font-size: 0.85rem;
}

.table-of-contents {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 4rem 2rem 2rem 0;
  color: #a9b1ba;
  font-size: 0.85rem;
  line-height: 1.45;
}

.table-of-contents details {
  padding-left: 1.25rem;
  border-left: 1px solid #30363d;
}

.table-of-contents summary {
  color: #f2f2f2;
  cursor: pointer;
  font-weight: 600;
}

.table-of-contents ol {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.table-of-contents ol ol {
  margin: 0.4rem 0 0.4rem 0.75rem;
}

.table-of-contents li + li {
  margin-top: 0.45rem;
}

.table-of-contents a {
  color: inherit;
}

.table-of-contents a:hover,
.table-of-contents a:focus-visible {
  color: #f2f2f2;
}

@media (max-width: 70rem) {
  .layout {
    grid-template-columns: minmax(17rem, 23rem) minmax(0, 54rem);
  }

  .table-of-contents {
    display: none;
  }
}

@media (max-width: 48rem) {
  .layout {
    display: block;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 2rem 1rem;
    border-right: 0;
    border-bottom: 1px solid #30363d;
  }

  .greeting,
  .sidebar .elsewhere,
  .note-nav::before {
    display: none;
  }

  .elsewhere-mobile {
    display: flex;
    margin: 0 1rem;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid #30363d;
  }

  .content {
    padding: 3rem 1rem 5rem;
  }

  pre {
    width: calc(100% + 2rem);
    margin-inline: -1rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0;
    font-size: 0.8rem;
  }
}

.apps-link { position: absolute; top: .75rem; right: 1rem; z-index: 2; padding: .4rem .9rem; border: 1px solid #465363; border-radius: .65rem; background: #20252b; font-weight: 600; }


.stats-toolbar { margin: 0 0 1rem; color: inherit; }
.stats-toolbar select { padding: 0.35rem; background: #20252b; color: #f2f2f2; border: 1px solid #30363d; border-radius: 0.35rem; font: inherit; }
.stats-chart svg { display: block; width: 100%; height: auto; }
.stats-chart text { fill: #a9b1ba; font-size: 12px; }
.stats-grid { stroke: #30363d; }
.stats-line { stroke: #79c0ff; stroke-width: 2; }
.stats-dot { fill: #79c0ff; }
.stats-note, #overview-status { color: #a9b1ba; font-size: 0.85rem; }
.stats-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 0.75rem; margin: 1.5rem 0; }
.stats-summary > div { padding: 0.85rem; border: 1px solid #30363d; border-radius: 0.35rem; }
.stats-summary dt { color: #a9b1ba; font-size: 0.8rem; }
.stats-summary dd { margin: 0.25rem 0 0; font-size: 1.4rem; font-weight: 600; }
