@font-face {
  font-family: "Palworld UI";
  src: url("../../../Tools/Font/NotoSans/NotoSans-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --map-surface: #09131b;
  --ink: #061722;
  --ink-deep: var(--map-surface);
  --panel: #0b2535;
  --panel-strong: #0d2c3f;
  --line: #1b4960;
  --line-bright: #23718a;
  --text: #effcff;
  --muted: #8ba8b5;
  --cyan: #13e5ed;
  --cyan-soft: #73e7ef;
  --amber: #ffc841;
  --glass: rgb(6 23 34 / 90%);
  font-family: "Palworld UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0;
  background: var(--map-surface);
  overflow: hidden;
}
body {
  display: block;
}

body.app-map-page {
  --map-frame-gap: 40px;
  --map-sidebar-gap: 0px;
  --map-sidebar-width: clamp(360px, 28vw, 400px);
  --map-sidebar-content-top: calc(var(--app-chrome-header-height) - .75rem);
  --map-sidebar-content-inline: 16px;
  --map-source-notice-reserve: calc(1rem + 5rem);
  --map-toolbar-space: 31rem;
  --map-header-top-gap: 10px;
  --map-ui-light: #effcff;
  --map-ui-cyan: #51e8f2;
  --map-icon-light-filter: brightness(0) invert(1);
  --map-icon-cyan-filter: brightness(0) saturate(100%) invert(82%) sepia(52%) saturate(801%) hue-rotate(132deg) brightness(100%) contrast(94%);
}

.map-app {
  background: transparent !important;
}

body.app-chrome-page.app-map-page > .app-header {
  position: absolute;
  z-index: 1200;
  top: var(--map-header-top-gap);
  right: auto;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
}

body.app-chrome-page.app-map-page > .app-header nav::before {
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.app-chrome-page.app-map-page > .app-header nav a:not([aria-current="page"]):is(:hover, :focus-visible) {
  background: transparent;
  box-shadow: none;
}

button,
input { font: inherit; }

button { color: inherit; }
a { color: inherit; text-decoration: none; }

.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;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: .7rem;
  left: 50%;
  padding: .65rem 1rem;
  color: #00151d;
  font-weight: 800;
  text-decoration: none;
  background: var(--cyan);
  border-radius: .45rem;
  transform: translate(-50%, -180%);
}

.skip-link:focus { transform: translate(-50%, 0); }

.map-app {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

body.app-chrome-page.app-map-page > .map-app {
  min-height: 100dvh !important;
  height: 100dvh !important;
  flex: none !important;
}

@media (max-width: 900px) {
  body.app-map-page {
    --map-toolbar-space: 16rem;
  }

  body.app-chrome-page.app-map-page > .app-header { top: var(--map-header-top-gap); }
}

@media (max-width: 760px) {
  body.app-map-page {
    --map-sidebar-width: min(350px, 88vw);
    --map-sidebar-content-top: 6px;
    --map-source-notice-reserve: calc(76px + 44px + 1rem + 4rem + env(safe-area-inset-bottom));
    --map-toolbar-space: 0rem;
  }

  body.app-chrome-page.app-map-page > .app-header { top: var(--map-header-top-gap); }
}

.layers-panel {
  position: absolute;
  z-index: 1001;
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  width: var(--map-sidebar-width);
  flex-direction: column;
  padding-top: var(--map-sidebar-content-top);
  color: var(--text);
  inset: 0 auto 0 var(--map-sidebar-gap);
  max-height: none;
  transform: none;
  overflow: hidden;
  background: transparent;
  border-right: 0;
  box-shadow: none;
}

.layers-panel::before { display: none; content: none; }

@media (min-width: 761px) {
  .layers-panel { inset: 0 auto 0 var(--map-sidebar-gap); height: 100dvh; max-height: none; padding-top: var(--map-sidebar-content-top); transform: none; }
  body.layers-collapsed .layers-panel { transform: translateX(-105%); }
}

.sidebar-header {
  position: relative;
  z-index: 3;
  padding: 14px 16px 11px;
  background: transparent;
  border-bottom: 0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-close {
  display: none;
}

.world-tabs {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 3px;
  margin-top: 9px;
  padding-bottom: 4px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-bottom: 0;
  isolation: isolate;
}

.world-tabs::before { display: none; content: none; }

.world-tabs[data-active-space="worldTree"]::before { transform: translateX(calc(100% + 3px)); }

.world-tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 7px;
  color: #81979d;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px transparent;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.world-tab-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
  filter: saturate(.68) brightness(.78);
  opacity: .72;
  transition: opacity 180ms ease, filter 180ms ease, transform 180ms ease;
}

.world-tab > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-tab:not(.is-active):hover {
  color: #c6dce1;
  background: rgb(27 50 57 / 46%);
  border-color: rgb(91 130 139 / 42%);
}

.world-tab:not(.is-active):hover .world-tab-icon {
  filter: saturate(.9) brightness(.94);
  opacity: .9;
  transform: translateY(-1px);
}

.world-tab.is-active {
  color: #79e9f2;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.world-tab.is-active .world-tab-icon {
  filter: saturate(1.08) brightness(1.08);
  opacity: 1;
}

.world-tab small {
  color: #89b3c1;
  font-size: 10px;
  font-weight: 850;
}

.world-tab.is-active small { color: #8fe8ee; }

.map-search {
  display: grid;
  min-height: 38px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 0;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.sidebar-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
  margin-top: 8px;
}

.layer-view-toggle {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #91b4bd;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.layer-view-toggle:hover,
.layer-view-toggle:focus-visible {
  color: #d9fcff;
  background: rgb(15 55 65 / 78%);
  border-color: transparent;
  box-shadow: none;
  outline: 0;
}

.layer-view-toggle[aria-pressed="true"] { color: var(--cyan); border-color: transparent; }

.layer-view-toggle-icon {
  width: 17px;
  height: 17px;
  background:
    linear-gradient(currentcolor, currentcolor) 0 0 / 7px 7px no-repeat,
    linear-gradient(currentcolor, currentcolor) 10px 0 / 7px 7px no-repeat,
    linear-gradient(currentcolor, currentcolor) 0 10px / 7px 7px no-repeat,
    linear-gradient(currentcolor, currentcolor) 10px 10px / 7px 7px no-repeat;
  opacity: .9;
}

.layers-panel.is-compact .layer-view-toggle-icon {
  background:
    linear-gradient(currentcolor, currentcolor) 0 1px / 17px 2px no-repeat,
    linear-gradient(currentcolor, currentcolor) 0 7px / 17px 2px no-repeat,
    linear-gradient(currentcolor, currentcolor) 0 13px / 17px 2px no-repeat;
}

.map-search-icon {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  justify-self: center;
  color: #8db4bd;
  pointer-events: none;
}

.map-search-icon::before {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentcolor;
  border-radius: 50%;
  content: "";
}

.map-search-icon::after {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 6px;
  height: 1.5px;
  background: currentcolor;
  border-radius: 1px;
  content: "";
  transform: rotate(45deg);
  transform-origin: right center;
}

.map-search input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.map-search:focus-within { border-color: transparent; box-shadow: none; }
.map-search:focus-within .map-search-icon { color: var(--cyan); }
.map-search input::placeholder { color: #6e929f; }

.sidebar-scroll {
  position: relative;
  z-index: 3;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin: 0 8px 8px;
  overflow-y: auto;
  padding: 8px 10px 18px;
  background: transparent;
  border: 0;
  scrollbar-gutter: stable;
  scrollbar-color: #91a8ad transparent;
  scrollbar-width: thin;
}

