:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1d3553;
  background: #eaf3fb;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 82% 8%, rgb(165 203 235 / 48%), transparent 30%),
    linear-gradient(145deg, #f4f9fd 0%, #dfeefa 100%);
}

.about-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px max(24px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid rgb(189 207 221 / 75%);
  background: rgb(244 249 253 / 90%);
  color: #718095;
  font-size: 13px;
  backdrop-filter: blur(14px);
}

.about-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.about-theme-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #c8d9e6;
  border-radius: 999px;
  background: rgb(255 255 255 / 88%);
}

.about-theme-switch button {
  display: grid;
  width: 38px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #54708a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.about-theme-switch button.active {
  background: #205c8d;
  color: #fff;
}

.back-link,
.about-footer a {
  color: #285f91;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover,
.about-footer a:hover {
  text-decoration: underline;
}

.readme-shell {
  display: grid;
  width: min(1440px, calc(100% - 40px));
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  margin: 32px auto;
}

.table-of-contents {
  position: sticky;
  top: 72px;
  overflow: hidden;
  max-height: calc(100vh - 96px);
  padding: 18px 10px 18px 16px;
  border: 1px solid rgb(189 207 221 / 72%);
  border-radius: 20px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 12px 34px rgb(36 77 113 / 8%);
}

.toc-title {
  margin: 0 8px 12px;
  color: #142b4a;
  font-size: 15px;
  font-weight: 800;
}

.toc-search {
  position: relative;
  margin: 0 6px 12px 0;
}

.toc-search input {
  width: 100%;
  height: 38px;
  padding: 0 42px 0 12px;
  border: 1px solid #cddde9;
  border-radius: 11px;
  outline: 0;
  background: #f7fafc;
  color: #203d5d;
  font: inherit;
  font-size: 12px;
}

.toc-search input:focus {
  border-color: #6c9fc5;
  background: #fff;
  box-shadow: 0 0 0 3px rgb(61 126 177 / 12%);
}

.toc-search input::-webkit-search-cancel-button {
  display: none;
}

.search-shortcut {
  position: absolute;
  top: 50%;
  right: 9px;
  padding: 2px 5px;
  border: 1px solid #d5e2ec;
  border-radius: 5px;
  background: #fff;
  color: #7890a4;
  font-size: 10px;
  transform: translateY(-50%);
  pointer-events: none;
}

.toc-navigation {
  overflow-y: auto;
  max-height: calc(100vh - 145px);
  padding-right: 6px;
  scrollbar-color: #bdd1e1 transparent;
  scrollbar-width: thin;
}

.toc-group + .toc-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #dce7ef;
}

.toc-group-title {
  margin: 0 9px 7px;
  color: #7b8da0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.toc-group:first-child .toc-link {
  background: #edf5fa;
  color: #285f91;
  font-weight: 700;
}

.toc-group:first-child .toc-link.active {
  background: #dcecf7;
  color: #174d79;
}

.toc-link {
  display: block;
  margin: 2px 0;
  padding: 7px 9px;
  border-radius: 9px;
  color: #526b83;
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.toc-link:hover {
  background: #edf5fa;
  color: #285f91;
}

.toc-link.active {
  background: #e1eef7;
  color: #174d79;
  font-weight: 750;
}

.search-results {
  overflow-y: auto;
  max-height: calc(100vh - 196px);
  padding-right: 6px;
  scrollbar-color: #bdd1e1 transparent;
  scrollbar-width: thin;
}

.search-summary {
  padding: 2px 8px 8px;
  color: #718398;
  font-size: 11px;
}

.search-result {
  display: block;
  margin: 3px 0;
  padding: 9px;
  border-radius: 10px;
  color: #526b83;
  text-decoration: none;
}

.search-result:hover {
  background: #edf5fa;
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result strong {
  margin-bottom: 3px;
  color: #244c72;
  font-size: 12px;
}

.search-result span {
  font-size: 10px;
  line-height: 1.4;
}

.search-result mark {
  border-radius: 2px;
  background: #ffe59a;
  color: inherit;
}

::highlight(documentation-search) {
  background: #ffe59a;
  color: inherit;
}

.readme-content {
  padding: clamp(30px, 5vw, 70px);
  border: 1px solid rgb(189 207 221 / 72%);
  border-radius: 28px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 18px 50px rgb(36 77 113 / 10%);
  line-height: 1.68;
}

.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4 {
  scroll-margin-top: 76px;
  color: #142b4a;
  line-height: 1.22;
}

.readme-content h1 {
  margin: 0 0 32px;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.04em;
}

.readme-content h2 {
  margin: 56px 0 18px;
  padding-top: 18px;
  border-top: 1px solid #dce7ef;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.025em;
}

.readme-content h3 {
  margin: 36px 0 14px;
  font-size: 22px;
}

.readme-content h4 {
  margin: 28px 0 12px;
  font-size: 18px;
}

.readme-content p,
.readme-content li {
  color: #344a63;
}

.readme-content a {
  color: #1768a3;
  text-underline-offset: 3px;
}

.readme-content blockquote {
  margin: 24px 0;
  padding: 14px 20px;
  border-left: 4px solid #65a2cf;
  border-radius: 0 12px 12px 0;
  background: #eef6fc;
}

.readme-content blockquote p {
  margin: 0;
}

.readme-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #edf3f7;
  color: #9b3152;
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.readme-content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: 14px;
  background: #142b4a;
  color: #eaf3fb;
}

.readme-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.readme-content table {
  display: block;
  overflow-x: auto;
  width: 100%;
  margin: 22px 0;
  border-spacing: 0;
  border-collapse: collapse;
}

.readme-content th,
.readme-content td {
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid #d8e4ed;
  text-align: left;
  vertical-align: top;
}

.readme-content th {
  background: #edf5fa;
  color: #244c72;
}

.readme-content hr {
  margin: 42px 0;
  border: 0;
  border-top: 1px solid #dce7ef;
}

.about-footer {
  padding: 8px 20px 34px;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 700px) {
  .about-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .about-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .readme-shell {
    display: block;
    width: min(100% - 20px, 1100px);
    margin: 14px auto;
  }

  .table-of-contents {
    position: relative;
    top: auto;
    max-height: none;
    margin-bottom: 12px;
    padding: 14px 10px 14px 14px;
    border-radius: 16px;
  }

  .toc-navigation {
    max-height: 220px;
  }

  .search-results {
    max-height: 260px;
  }

  .readme-content {
    padding: 24px 18px;
    border-radius: 20px;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  color: #dce8f4;
  background: #101b28;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% 8%, rgb(35 91 132 / 42%), transparent 34%),
    linear-gradient(145deg, #111d2a 0%, #172b3d 100%);
}

html[data-theme="dark"] .about-header {
  border-color: #334b60;
  background: rgb(18 31 44 / 92%);
  color: #91a8bb;
}

html[data-theme="dark"] .about-theme-switch {
  border-color: #3a5368;
  background: #1d3042;
}

html[data-theme="dark"] .about-theme-switch button {
  color: #a9bfd2;
}

html[data-theme="dark"] .about-theme-switch button.active {
  background: #4b8fc1;
  color: #fff;
}

html[data-theme="dark"] :is(.table-of-contents, .readme-content) {
  border-color: #334b60;
  background: rgb(24 39 54 / 96%);
  box-shadow: 0 14px 40px rgb(0 0 0 / 22%);
}

html[data-theme="dark"] :is(
  .toc-title,
  .readme-content h1,
  .readme-content h2,
  .readme-content h3,
  .readme-content h4
) {
  color: #e8f2fb;
}

html[data-theme="dark"] :is(.readme-content p, .readme-content li) {
  color: #bfd0df;
}

html[data-theme="dark"] :is(.back-link, .about-footer a, .readme-content a) {
  color: #83bee9;
}

html[data-theme="dark"] :is(.toc-link, .search-result) {
  color: #a9bfd2;
}

html[data-theme="dark"] :is(
  .toc-link:hover,
  .toc-link.active,
  .toc-group:first-child .toc-link,
  .toc-group:first-child .toc-link.active,
  .search-result:hover
) {
  background: #29465d;
  color: #dcecf7;
}

html[data-theme="dark"] :is(.toc-group + .toc-group, .readme-content h2, .readme-content hr) {
  border-color: #3a5368;
}

html[data-theme="dark"] .toc-search input {
  border-color: #3b566d;
  background: #1f3447;
  color: #edf5fb;
}

html[data-theme="dark"] .toc-search input:focus {
  border-color: #6598bd;
  background: #29465d;
}

html[data-theme="dark"] .search-shortcut {
  border-color: #3b566d;
  background: #203549;
  color: #91a8bb;
}

html[data-theme="dark"] .readme-content blockquote {
  background: #20384b;
}

html[data-theme="dark"] .readme-content code {
  background: #243a4d;
  color: #f0a8bf;
}

html[data-theme="dark"] .readme-content pre {
  background: #0d1823;
  color: #eaf3fb;
}

html[data-theme="dark"] .readme-content th {
  background: #29465d;
  color: #dcecf7;
}

html[data-theme="dark"] .readme-content :is(th, td) {
  border-color: #3b566d;
}
