:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg: #f5f7f8;
  --ink: #202326;
  --muted: #667178;
  --panel: rgba(255, 255, 255, 0.92);
  --line: #d7dde1;
  --blue: rgba(76, 166, 255, 0.72);
  --blue-dark: rgba(40, 126, 224, 0.78);
  --blue-soft: rgba(76, 166, 255, 0.14);
  --blue-line: rgba(74, 172, 255, 0.46);
  --blue-glow: rgba(74, 172, 255, 0.16);
  --teal: #087c72;
  --orange: #c25a1a;
  --red: #b73535;
  --grid-size: 56px;
  --grid-x: 0px;
  --grid-y: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  position: relative;
}

#grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(65, 82, 93, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(65, 82, 93, 0.09) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(8, 124, 114, 0.12) 1px, transparent 1.5px);
  background-position:
    var(--grid-x) var(--grid-y),
    var(--grid-x) var(--grid-y),
    var(--grid-x) var(--grid-y);
  background-size:
    var(--grid-size) var(--grid-size),
    var(--grid-size) var(--grid-size),
    calc(var(--grid-size) * 2) calc(var(--grid-size) * 2);
}

.canvas {
  cursor: grab;
  inset: 0;
  position: absolute;
  touch-action: none;
}

.canvas.is-panning {
  cursor: grabbing;
}

.world {
  inset: 0 auto auto 0;
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
}

#pageLayer,
#markerLayer {
  inset: 0 auto auto 0;
  position: absolute;
}

#markerLayer {
  z-index: 3;
}

#pageLayer {
  z-index: 2;
}

#edges {
  height: 100%;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.edge {
  fill: none;
  opacity: 1;
  stroke: var(--blue-line);
  stroke-linecap: round;
  stroke-width: 3;
}

.edge-glow {
  fill: none;
  opacity: 1;
  stroke: var(--blue-glow);
  stroke-linecap: round;
  stroke-width: 12;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 12px;
  left: 16px;
  max-width: min(700px, calc(100vw - 32px));
  position: absolute;
  top: 16px;
  z-index: 20;
}

.brand,
.searchbox,
.toolrail {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid rgba(174, 184, 191, 0.72);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(24, 33, 40, 0.12);
}

.brand {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
  height: 44px;
  padding: 0 13px 0 10px;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}

.searchbox {
  align-items: center;
  display: flex;
  flex: 1 1 390px;
  height: 44px;
  min-width: 230px;
  padding: 0 6px 0 12px;
  position: relative;
}

.tool-icon {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
}

.searchbox input {
  background: transparent;
  border: 0;
  color: var(--ink);
  flex: 1 1 auto;
  height: 40px;
  min-width: 0;
  outline: 0;
  padding: 0 10px;
}

.searchbox input::placeholder {
  color: #78858e;
}

.search-results {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(24, 33, 40, 0.18);
  left: 0;
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
}

.result-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  min-height: 38px;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
}

.result-item:hover,
.result-item:focus-visible {
  background: #eef5f3;
  outline: 0;
}

.toolrail {
  bottom: 18px;
  display: flex;
  gap: 4px;
  left: 50%;
  padding: 5px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 19;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #e9f0ee;
  outline: 0;
}

.icon-button:disabled {
  color: #a2a9b1;
  cursor: default;
  opacity: 0.58;
}

.icon-button:disabled:hover,
.icon-button:disabled:focus-visible {
  background: transparent;
}

.icon-button.is-pressed {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.icon-button.is-off {
  color: #87949d;
}

.icon-button.danger:hover,
.icon-button.danger:focus-visible {
  background: #f7e8e8;
  color: var(--red);
}

.wiki-pane {
  --pane-width: 980px;
  --pane-height: 760px;
  background: #fff;
  border: 1px solid #a2a9b1;
  border-radius: 7px;
  box-shadow: 0 22px 58px rgba(25, 35, 43, 0.2);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--pane-height);
  overflow: hidden;
  position: absolute;
  transform: translate(var(--x), var(--y));
  transform-origin: 0 0;
  width: var(--pane-width);
}

.wiki-pane.active {
  border-color: rgba(194, 90, 26, 0.72);
  box-shadow:
    0 0 0 3px rgba(194, 90, 26, 0.13),
    0 22px 58px rgba(25, 35, 43, 0.23);
}

.wiki-pane.entering {
  animation: paneReveal 520ms cubic-bezier(0.17, 0.9, 0.25, 1) both;
}

.pane-chrome {
  align-items: center;
  background: #f8f9fa;
  border-bottom: 1px solid #c8ccd1;
  cursor: move;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px) auto;
  min-height: 52px;
  padding: 7px 10px 7px 16px;
}

.pane-title {
  min-width: 0;
}

.pane-title h1 {
  color: #202122;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-subtitle {
  color: #54595d;
  font-size: 12px;
  margin-top: 2px;
}

.pane-actions {
  align-items: center;
  display: flex;
  gap: 3px;
}

.pane-find {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #c8ccd1;
  border-radius: 6px;
  cursor: default;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr) 28px 28px minmax(38px, auto);
  height: 32px;
  min-width: 0;
  padding: 0 3px 0 8px;
}

.pane-find-input {
  background: transparent;
  border: 0;
  color: #202122;
  height: 28px;
  min-width: 0;
  outline: 0;
  padding: 0;
}

.pane-find-input::placeholder {
  color: #72777d;
}

.pane-find-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #54595d;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  height: 26px;
  justify-content: center;
  padding: 0;
  width: 26px;
}

.pane-find-button:hover,
.pane-find-button:focus-visible {
  background: #eaecf0;
  color: #202122;
  outline: 0;
}

.pane-find-button:disabled {
  color: #a2a9b1;
  cursor: default;
}

.pane-find-button:disabled:hover {
  background: transparent;
}

.pane-find-count {
  color: #54595d;
  font-size: 12px;
  line-height: 1;
  min-width: 38px;
  text-align: right;
}

.pane-action {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #54595d;
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  height: 32px;
  justify-content: center;
  text-decoration: none;
  width: 32px;
}

.pane-action:hover,
.pane-action:focus-visible {
  background: #eaecf0;
  color: #202122;
  outline: 0;
}

.pane-action.danger:hover,
.pane-action.danger:focus-visible {
  background: rgba(183, 53, 53, 0.1);
  color: var(--red);
}

.wiki-scroll {
  background: #fff;
  overflow: auto;
  overscroll-behavior: contain;
}

.wiki-body {
  color: #202122;
  font-family: sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 22px 32px 42px;
}

.wiki-body a {
  border-radius: 2px;
  color: var(--blue-dark);
  cursor: pointer;
  text-decoration: none;
}

.wiki-body a:hover,
.wiki-body a:focus-visible {
  background: var(--blue-soft);
  outline: 1px solid rgba(76, 166, 255, 0.3);
  text-decoration: underline;
}

.wiki-body a.visited-zui {
  background: rgba(76, 166, 255, 0.12);
  outline: 1px solid rgba(76, 166, 255, 0.34);
}

.wiki-body mark.find-hit {
  background: rgba(255, 230, 120, 0.48);
  border-radius: 2px;
  color: inherit;
  padding: 0 1px;
}

.wiki-body mark.find-current {
  background: rgba(76, 166, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(40, 126, 224, 0.38);
}

.wiki-body h1,
.wiki-body h2,
.wiki-body h3,
.wiki-body h4 {
  color: #202122;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.25;
}

.wiki-body h2 {
  border-bottom: 1px solid #a2a9b1;
  font-size: 22px;
  margin: 1.05em 0 0.35em;
}

.wiki-body img {
  max-width: 100%;
}

.wiki-body table {
  border-collapse: collapse;
}

.wiki-body .infobox,
.wiki-body .sidebar,
.wiki-body .vertical-navbox,
.wiki-body .thumb {
  max-width: 360px;
}

.wiki-body .thumb {
  background: #f8f9fa;
  border: 1px solid #c8ccd1;
  margin: 0.5em 0 0.8em 1.4em;
  padding: 4px;
}

.wiki-body .thumb.tright,
.wiki-body .floatright,
.wiki-body table.infobox {
  clear: right;
  float: right;
}

.wiki-body .thumb.tleft,
.wiki-body .floatleft {
  clear: left;
  float: left;
  margin-left: 0;
  margin-right: 1.4em;
}

.wiki-body .mw-editsection,
.wiki-body .noprint,
.wiki-body .metadata,
.wiki-body .reference {
  color: #54595d;
  font-size: 90%;
}

.wiki-body .mw-parser-output::after {
  clear: both;
  content: "";
  display: block;
}

.link-marker {
  align-items: center;
  background: rgba(236, 249, 255, 0.64);
  border: 2px solid rgba(76, 166, 255, 0.56);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(25, 35, 43, 0.22);
  color: rgba(35, 128, 220, 0.78);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  position: absolute;
  transform: translate(var(--x), var(--y));
  width: 24px;
  z-index: 4;
}

.link-marker.pulse {
  animation: markerPulse 620ms ease-out both;
}

.status {
  background: rgba(32, 35, 38, 0.88);
  border-radius: 7px;
  bottom: 18px;
  color: #fff;
  font-size: 12px;
  left: 18px;
  max-width: min(430px, calc(100vw - 36px));
  overflow: hidden;
  padding: 8px 10px;
  position: absolute;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 20;
}

@keyframes paneReveal {
  0% {
    filter: blur(5px);
    opacity: 0;
    transform: translate(var(--origin-x), var(--origin-y)) scale(0.2);
  }

  72% {
    filter: blur(0);
    opacity: 1;
    transform: translate(var(--x), var(--y)) scale(1.012);
  }

  100% {
    filter: blur(0);
    opacity: 1;
    transform: translate(var(--x), var(--y)) scale(1);
  }
}

@keyframes markerPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 166, 255, 0.34);
    transform: translate(var(--x), var(--y)) scale(0.72);
  }

  100% {
    box-shadow: 0 0 0 18px rgba(76, 166, 255, 0);
    transform: translate(var(--x), var(--y)) scale(1);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    left: 10px;
    max-width: calc(100vw - 20px);
    right: 10px;
    top: 10px;
  }

  .brand {
    align-self: flex-start;
  }

  .searchbox {
    flex-basis: auto;
    width: 100%;
  }

  .wiki-pane {
    --pane-width: 92vw;
    --pane-height: 72vh;
  }

  .pane-chrome {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pane-find {
    grid-column: 1 / -1;
    order: 3;
  }

  .pane-title h1 {
    font-size: 22px;
  }

  .wiki-body {
    font-size: 13px;
    padding: 18px 18px 36px;
  }

  .status {
    bottom: 72px;
    left: 10px;
  }
}
