.map-page {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(18px, 3vh, 28px);
  height: 100%;
  min-height: 0;
  padding:
    max(54px, calc(env(safe-area-inset-top) + 40px))
    max(22px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  background: var(--screen-wallpaper, var(--screen-default-wallpaper));
  background-position: center;
  background-size: cover;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(20px) scale(.985);
  transition: none;
}

.map-page.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.map-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.map-back,
.map-add {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.map-back:focus-visible,
.map-add:focus-visible {
  outline: 1px solid rgba(0, 0, 0, .34);
  outline-offset: 2px;
}

.map-back:active,
.map-add:active {
  transform: translateY(2px) scale(.94);
}

.map-back span {
  display: block;
  width: 12px;
  height: 12px;
  border-left: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translate(2px, -2px);
}

.map-add span {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.map-add.map-relation-focus-button {
  border-radius: 50%;
}

.map-header-relation-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .48);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .72),
    inset -1px -1px 2px rgba(0, 0, 0, .12);
  font-size: 13px !important;
  font-weight: 760 !important;
}

.map-header-relation-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-relation-focus-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 6px;
  width: min(240px, 72vw);
  max-height: min(320px, 52dvh);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  background: rgba(250, 250, 249, .72);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, .10),
    inset 1px 1px 1px rgba(255, 255, 255, .78),
    inset -1px -1px 2px rgba(0, 0, 0, .12);
}

.map-relation-focus-menu[hidden] {
  display: none;
}

.map-relation-focus-menu button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 46px;
  padding: 5px 7px;
  color: #111;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-family: "Noto Serif SC", "Songti SC", serif;
  text-align: left;
  cursor: pointer;
}

.map-relation-focus-menu button[aria-checked="true"] {
  border-color: rgba(17, 17, 17, .18);
  background: rgba(255, 255, 255, .42);
}

.map-relation-focus-menu button > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-relation-focus-menu strong,
.map-relation-focus-menu small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-relation-focus-menu strong {
  font-size: 12px;
  font-weight: 680;
  line-height: 1.18;
}

.map-relation-focus-menu small {
  color: rgba(0, 0, 0, .50);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.15;
}

.map-relation-focus-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  color: rgba(17, 17, 17, .72);
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 50%;
  background: rgba(255, 255, 255, .54);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 760;
}

.map-relation-focus-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-title {
  justify-self: center;
  display: inline-grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  max-width: 100%;
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.map-title > #mapTitleText {
  color: var(--ink);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.map-page[data-view="detail"] .map-title > #mapTitleText {
  max-width: min(42vw, 220px);
}

.map-title-meta {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  min-width: 0;
  max-width: min(34vw, 150px);
}

.map-title-meta[hidden] {
  display: none;
}

.map-title-meta small {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: rgba(17, 17, 17, .58);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9.5px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.map-title-weather[data-tone="error"] {
  color: #9b1c1c;
}

.map-content {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}

.map-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.map-page[data-view="list"] .map-content {
  align-items: start;
}

.map-page[data-view="list"] .map-viewer {
  align-self: start;
  min-height: auto;
}

.map-page[data-view="list"] .map-empty {
  align-self: center;
}

.map-page[data-view="detail"] {
  gap: clamp(10px, 1.8vh, 18px);
}

.map-page[data-view="detail"] .map-content {
  align-items: stretch;
  justify-items: stretch;
  overflow: hidden;
  padding: 0;
}

.map-page[data-view="detail"] .map-viewer {
  align-content: stretch;
  justify-items: stretch;
  height: 100%;
  min-height: 0;
  padding-block: 0;
}

.map-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 260px);
  min-height: 0;
  padding: 24px 10px;
  color: rgba(17, 17, 17, .54);
  text-align: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.map-empty::before {
  content: "";
  display: block;
  width: 72px;
  aspect-ratio: 1;
  border-radius: 20px;
  background: url("./assets/apps/map.png") center / contain no-repeat;
  overflow: hidden;
}

.map-empty strong {
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.map-empty span {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  line-height: 1.35;
}

.map-viewer {
  display: grid;
  justify-items: center;
  align-content: start;
  width: 100%;
  min-height: 100%;
  padding-block: clamp(8px, 2dvh, 22px);
}

.map-viewer[hidden],
.map-empty[hidden],
.map-dialog-card [hidden],
.map-place-dialog-card [hidden],
.map-rule-dialog-card [hidden],
.map-relation-dialog-card [hidden] {
  display: none;
}

.map-saved-list {
  display: grid;
  align-content: start;
  gap: 22px;
  width: min(100%, 560px);
  min-width: 0;
}

.map-saved-list[hidden],
.map-detail[hidden],
.map-detail [hidden] {
  display: none !important;
}

.map-card {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  gap: 12px;
}

.map-preview {
  border: 1px solid rgba(0, 0, 0, .075);
  border-radius: 8px;
  background: rgba(255, 255, 255, .54);
  box-shadow: none;
}

.map-image-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 18px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: background .18s ease, transform .18s ease;
}

.map-image-frame:focus-visible {
  outline: 1px solid rgba(0, 0, 0, .34);
  outline-offset: 4px;
}

.map-image-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 2px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .2) 34%, rgba(0, 0, 0, .1) 72%, rgba(0, 0, 0, .18)),
    linear-gradient(315deg, rgba(0, 0, 0, .11), transparent 46%, rgba(255, 255, 255, .58));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.screen.app-icon-border-disabled .map-image-frame::before {
  content: none;
}

.map-card[aria-current="true"] .map-image-frame::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .24) 34%, rgba(0, 0, 0, .14) 72%, rgba(0, 0, 0, .24)),
    linear-gradient(315deg, rgba(0, 0, 0, .14), transparent 46%, rgba(255, 255, 255, .66));
}

.map-image-frame:active {
  background: rgba(0, 0, 0, .035);
  transform: translateY(2px) scale(.94);
}

.map-image-frame img,
.map-preview img {
  display: block;
  width: 100%;
  height: 100%;
}

.map-preview img {
  object-fit: contain;
}

.map-page.open .map-image-frame img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 5px;
  animation: map-preview-drift 38s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes map-preview-drift {
  0% {
    transform: scale(1.045) translate3d(-1.8%, -1.2%, 0);
  }

  50% {
    transform: scale(1.06) translate3d(1.4%, -1.8%, 0);
  }

  100% {
    transform: scale(1.05) translate3d(1.8%, 1.3%, 0);
  }
}

.map-card-meta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 10px 10px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  box-shadow: none;
}

.map-card-meta::before,
.map-enter-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 2px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .2) 34%, rgba(0, 0, 0, .1) 72%, rgba(0, 0, 0, .18)),
    linear-gradient(315deg, rgba(0, 0, 0, .11), transparent 46%, rgba(255, 255, 255, .58));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.map-card-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.map-saved-name,
.map-world-type-tag {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-saved-name {
  color: var(--ink);
  max-width: 100%;
  text-shadow: 0 1px 12px rgba(255, 255, 255, .78);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.22;
}

.map-card[aria-current="true"] .map-saved-name {
  font-weight: 600;
}

.map-world-type-tag {
  color: rgba(17, 17, 17, .56);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.map-time-label {
  color: rgba(17, 17, 17, .48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.map-weather-label {
  color: rgba(17, 17, 17, .54);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.28;
}

.map-weather-label[data-tone="error"] {
  color: #9b1c1c;
}

.map-enter-button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 38px;
  color: #171512;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  box-shadow: none;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  opacity: .92;
  cursor: pointer;
  pointer-events: auto;
}

.map-enter-button:focus-visible {
  outline: 1px solid rgba(0, 0, 0, .34);
  outline-offset: 3px;
}

.map-enter-button:active {
  transform: translateY(2px) scale(.94);
}

.map-detail {
  --map-detail-nav-height: clamp(108px, 16vh, 132px);
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  isolation: isolate;
}

.map-detail-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
  contain: layout paint;
  cursor: grab;
  touch-action: none;
}

.map-detail-stage:active {
  cursor: grabbing;
}

.map-detail-stage::after {
  content: none;
}

.map-detail-world {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 100%;
  min-height: 100%;
  transform-origin: 0 0;
  backface-visibility: hidden;
  contain: layout style;
  will-change: transform;
}

.map-detail-world > img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.map-place-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.map-place-pin {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 58px;
  color: #111;
  transform: scale(var(--map-detail-pin-scale, 1)) translate(-50%, -100%);
  transform-origin: left top;
  cursor: pointer;
  touch-action: none;
}

.map-place-pin-mark {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: #111;
  transform: rotate(-45deg);
}

.map-place-pin-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
}

.map-place-pin small {
  max-width: 96px;
  min-height: 16px;
  padding: 2px 5px;
  overflow: hidden;
  color: #111;
  border-radius: 8px;
  background: rgba(255, 255, 255, .68);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
}

.map-place-pin:focus-visible {
  outline: 1px solid rgba(0, 0, 0, .34);
  outline-offset: 8px;
}

.map-place-pin[aria-pressed="true"] .map-place-pin-mark,
.map-detail-editing .map-place-pin:hover .map-place-pin-mark {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .42);
}

.map-place-pin[aria-pressed="true"] .map-place-pin-mark[data-place-icon="black"],
.map-detail-editing .map-place-pin:hover .map-place-pin-mark[data-place-icon="black"] {
  background: #000;
}

.map-detail-editing .map-place-pin {
  cursor: grab;
}

.map-detail-editing .map-place-pin:active {
  cursor: grabbing;
}

.map-detail-world[data-map-image-kind="relations"] {
  background: transparent;
}

.map-relation-edge-layer,
.map-relation-node-layer {
  position: absolute;
  inset: 0;
}

.map-detail:not([data-tab="relations"]) .map-relation-edge-layer,
.map-detail:not([data-tab="relations"]) .map-relation-node-layer,
.map-detail[data-tab="relations"] .map-place-layer,
.map-detail[data-tab="relations"] .map-detail-world > img {
  display: none !important;
}

.map-relation-edge-layer {
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}

.map-relation-edge-layer marker path {
  fill: rgba(170, 170, 170, .92);
}

.map-relation-edge {
  fill: none;
  stroke: rgba(170, 170, 170, .82);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-relation-edge.is-bidirectional {
  stroke: rgba(158, 158, 158, .88);
}

.map-relation-edge.is-one-way {
  stroke-width: 1.1;
}

.map-relation-label-object {
  overflow: visible;
  pointer-events: none;
}

.map-relation-label-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.map-relation-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  height: 22px;
  box-sizing: border-box;
  padding: 0 8px;
  overflow: hidden;
  color: rgba(74, 74, 74, .78);
  border: 1px solid rgba(170, 170, 170, .34);
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .76),
    inset -1px -1px 2px rgba(0, 0, 0, .08);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  font-weight: 620;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-relation-node-layer {
  z-index: 3;
}

.map-relation-card {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 116px;
  min-height: 148px;
  padding: 8px 8px 12px;
  color: #111;
  border: 2px solid rgba(255, 255, 255, .54);
  border-radius: 4px;
  background: rgba(255, 255, 255, .34);
  box-shadow:
    0 14px 24px rgba(0, 0, 0, .09),
    inset 1px 1px 1px rgba(255, 255, 255, .88),
    inset -1px -1px 2px rgba(0, 0, 0, .14);
  font-family: "Noto Serif SC", "Songti SC", serif;
  line-height: 1.15;
  transform: translate(-50%, -50%);
  touch-action: none;
  cursor: grab;
}

.map-relation-card:active {
  cursor: grabbing;
}

.map-relation-card[aria-pressed="true"] {
  border-color: rgba(17, 17, 17, .62);
  animation: map-relation-selected-pulse 1.15s ease-in-out infinite;
}

.map-relation-photo {
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  overflow: hidden;
  color: rgba(17, 17, 17, .68);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 3px;
  background: rgba(245, 245, 242, .62);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .78),
    inset -1px -1px 2px rgba(0, 0, 0, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 28px;
  font-weight: 780;
}

.map-relation-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-relation-card strong,
.map-relation-card small {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-relation-card strong {
  font-size: 13px;
  font-weight: 680;
}

.map-relation-card small {
  color: rgba(0, 0, 0, .50);
  font-size: 10px;
  font-weight: 650;
}

.map-relation-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(260px, 72vw);
  color: rgba(0, 0, 0, .52);
  text-align: center;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  line-height: 1.45;
  transform: translate(-50%, -50%);
}

.map-relation-hint {
  position: absolute;
  left: clamp(14px, 4vw, 26px);
  right: clamp(14px, 4vw, 26px);
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 8;
  margin: 0;
  color: rgba(0, 0, 0, .52);
  text-align: center;
  text-shadow: 0 1px 10px rgba(255, 255, 255, .86);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

@keyframes map-relation-selected-pulse {
  0%, 100% {
    box-shadow:
      0 14px 24px rgba(0, 0, 0, .09),
      0 0 0 0 rgba(17, 17, 17, .18),
      inset 1px 1px 1px rgba(255, 255, 255, .88),
      inset -1px -1px 2px rgba(0, 0, 0, .14);
  }
  50% {
    box-shadow:
      0 14px 24px rgba(0, 0, 0, .12),
      0 0 0 6px rgba(17, 17, 17, .06),
      inset 1px 1px 1px rgba(255, 255, 255, .88),
      inset -1px -1px 2px rgba(0, 0, 0, .14);
  }
}

.map-detail-search {
  position: absolute;
  left: clamp(34px, 9vw, 58px);
  right: clamp(34px, 9vw, 58px);
  top: clamp(12px, 2.4vh, 22px);
  z-index: 6;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  padding: 5px 14px 5px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, .08),
    inset 1px 1px 0 rgba(255, 255, 255, .44),
    inset -1px -1px 0 rgba(0, 0, 0, .10);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: paint;
}

.map-detail-search::before,
.map-detail-search::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.map-detail-search::before {
  z-index: 0;
  padding: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .20) 34%, rgba(0, 0, 0, .10) 72%, rgba(0, 0, 0, .18)),
    linear-gradient(315deg, rgba(0, 0, 0, .11), transparent 46%, rgba(255, 255, 255, .56));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.map-detail-search::after {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22), transparent 48%),
    linear-gradient(90deg, rgba(255, 255, 255, .16), transparent 42%, rgba(0, 0, 0, .06));
}

.map-detail-search input {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 34px;
  color: #111;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 14px;
  letter-spacing: 0;
}

.map-detail-search button,
.map-selected-place button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #111;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .46);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(238, 237, 233, .58)),
    rgba(255, 255, 255, .62);
  box-shadow:
    0 7px 14px rgba(0, 0, 0, .11),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(0, 0, 0, .08);
  cursor: pointer;
}

.map-detail-search button {
  order: -1;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.map-detail-search svg,
.map-detail-nav svg,
.map-selected-place svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.map-detail-search svg {
  width: 20px;
  height: 20px;
}

.map-detail-status {
  position: absolute;
  left: clamp(14px, 4vw, 26px);
  right: clamp(14px, 4vw, 26px);
  top: clamp(64px, 9vh, 84px);
  z-index: 5;
  margin: 0;
  min-height: 18px;
  color: rgba(0, 0, 0, .58);
  text-align: center;
  text-shadow: 0 1px 10px rgba(255, 255, 255, .88);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}

.map-detail-status[data-tone="error"] {
  color: #9b1c1c;
}

.map-selected-place {
  position: absolute;
  left: clamp(10px, 3vw, 20px);
  right: clamp(10px, 3vw, 20px);
  bottom: calc(var(--map-detail-nav-height) + 12px);
  z-index: 7;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  min-height: 106px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, .075);
  border-radius: 8px;
  background: rgba(250, 250, 249, .90);
  box-shadow: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: paint;
}

.map-selected-place img {
  display: block;
  width: 92px;
  height: 86px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .07);
}

.map-selected-place div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.map-selected-place strong,
.map-selected-place small,
.map-selected-place p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-selected-place strong {
  color: #111;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.map-selected-place small {
  color: rgba(0, 0, 0, .54);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.map-selected-place p {
  display: -webkit-box;
  color: rgba(0, 0, 0, .64);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  line-height: 1.38;
}

.map-selected-place button {
  width: 42px;
  height: 42px;
  align-self: end;
}

.map-detail-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  min-height: var(--map-detail-nav-height);
  padding: 30px 8px 16px;
  border: 0;
  border-radius: 32px 32px 8px 8px;
  background: rgba(255, 255, 255, .14);
  box-shadow:
    0 -14px 28px rgba(0, 0, 0, .10),
    inset 1px 1px 0 rgba(255, 255, 255, .42),
    inset -1px -1px 0 rgba(0, 0, 0, .08);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: paint;
}

.map-detail-nav::before,
.map-detail-nav::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.map-detail-nav::before {
  inset: 0;
  z-index: 0;
  padding: 2px;
  border-radius: inherit;
  background:
    linear-gradient(116deg, transparent 0%, transparent 9%, rgba(255, 255, 255, .26) 14%, rgba(255, 255, 255, .10) 21%, transparent 32%),
    linear-gradient(135deg, rgba(42, 52, 68, .18) 0%, rgba(255, 255, 255, .62) 13%, rgba(255, 255, 255, .22) 34%, rgba(0, 0, 0, .085) 72%, rgba(0, 0, 0, .14)),
    radial-gradient(circle at 6% 8%, rgba(34, 45, 62, .13), rgba(255, 255, 255, .16) 30%, transparent 52%),
    linear-gradient(315deg, rgba(0, 0, 0, .09), transparent 48%, rgba(255, 255, 255, .58));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.map-detail-nav::after {
  left: 0;
  right: 0;
  top: 0;
  z-index: 0;
  height: 64%;
  border-radius: inherit;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .035) 24%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, .23), transparent 62%),
    linear-gradient(90deg, rgba(255, 255, 255, .14), transparent 50%, rgba(0, 0, 0, .045));
}

.map-detail-nav.map-detail-nav-suppressed {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-detail-nav button {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  min-width: 0;
  color: #111;
  cursor: pointer;
}

.map-detail-nav button:not(.map-detail-edit-toggle)::before,
.map-detail-nav button:not(:last-child)::after {
  content: none;
}

.map-detail-nav button svg {
  position: relative;
  z-index: 1;
}

.map-detail-nav svg {
  width: 25px;
  height: 25px;
}

.map-detail-nav button:active svg,
.map-detail-nav button:active span {
  transform: translateY(1px);
}

.map-detail-nav button span {
  position: relative;
  z-index: 1;
  max-width: 72px;
  min-height: 18px;
  overflow-wrap: anywhere;
  text-align: center;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  line-height: 1.2;
}

.map-detail-nav button[aria-selected="true"] span,
.map-detail-edit-toggle.active {
  font-weight: 650;
}

.map-detail-nav button[aria-selected="true"]:not(.map-detail-edit-toggle) span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.map-detail-edit-toggle {
  align-content: start;
}

.map-detail-edit-toggle > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-top: -12px;
  color: #fff;
  border-radius: 50%;
  background: #050505;
  border: 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 38px !important;
  font-weight: 300;
  line-height: 1;
}

.map-detail-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px 18px calc(var(--map-detail-nav-height) + 24px);
  text-align: center;
  background: rgba(255, 255, 255, .18);
}

.map-detail-placeholder strong {
  color: #111;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
}

.map-detail-placeholder small {
  color: rgba(0, 0, 0, .46);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
  line-height: 1;
}

.map-detail-placeholder p {
  max-width: 280px;
  margin: 0;
  color: rgba(0, 0, 0, .58);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  line-height: 1.55;
}

.map-rule-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: start;
  overflow-y: auto;
  padding: clamp(14px, 2.8vh, 22px) clamp(10px, 3vw, 22px) calc(var(--map-detail-nav-height) + 18px);
  background: rgba(255, 255, 255, .18);
  scrollbar-width: none;
}

.map-rule-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.map-rule-list {
  display: grid;
  gap: 10px;
  width: min(100%, 520px);
  min-width: 0;
  margin: 0 auto;
}

.map-rule-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: rgba(0, 0, 0, .52);
  text-align: center;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  line-height: 1.4;
}

.map-rule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .075);
  border-radius: 8px;
  background: rgba(250, 250, 249, .86);
  box-shadow: none;
  cursor: pointer;
}

.map-rule-card:focus-visible {
  outline: 1px solid rgba(0, 0, 0, .34);
  outline-offset: 3px;
}

.map-rule-card.is-disabled .map-rule-card-body {
  opacity: .48;
}

.map-rule-card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.map-rule-card h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #111;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.28;
}

.map-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.map-rule-meta span {
  max-width: 100%;
  min-height: 24px;
  padding: 4px 8px;
  overflow-wrap: anywhere;
  color: rgba(0, 0, 0, .60);
  border: 1px solid rgba(0, 0, 0, .065);
  border-radius: 999px;
  background: rgba(255, 255, 255, .46);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.map-rule-keyword-chip {
  color: #111 !important;
  background: rgba(255, 255, 255, .72) !important;
}

.map-rule-content {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(0, 0, 0, .62);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  line-height: 1.45;
}

.map-rule-entry-switch {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  margin-top: 1px;
  cursor: pointer;
}

.map-rule-entry-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-rule-entry-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #111;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, .26),
    inset -1px -1px 3px rgba(0, 0, 0, .22);
}

.map-rule-entry-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 21px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
  transition: transform .16s ease;
}

.map-rule-entry-switch input:not(:checked) + span {
  background: rgba(0, 0, 0, .16);
}

.map-rule-entry-switch input:not(:checked) + span::after {
  transform: translateX(-18px);
}

.map-dialog,
.map-action-dialog,
.map-place-dialog,
.map-rule-dialog,
.map-relation-dialog {
  position: absolute;
  inset: 0;
  z-index: 13;
  display: grid;
  place-items: center;
  padding:
    max(24px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  background: rgba(245, 245, 243, .56);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: none;
}

.map-dialog.open,
.map-action-dialog.open,
.map-place-dialog.open,
.map-rule-dialog.open,
.map-relation-dialog.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.map-dialog-card,
.map-action-card,
.map-place-dialog-card,
.map-rule-dialog-card,
.map-relation-dialog-card {
  display: grid;
  gap: 12px;
  width: min(100%, 390px);
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  background: rgba(250, 250, 249, .96);
  box-shadow: none;
  transform: translateY(16px) scale(.98);
  transition: none;
}

.map-action-card {
  gap: 16px;
}

.map-dialog.open .map-dialog-card,
.map-action-dialog.open .map-action-card,
.map-place-dialog.open .map-place-dialog-card,
.map-rule-dialog.open .map-rule-dialog-card,
.map-relation-dialog.open .map-relation-dialog-card {
  transform: translateY(0) scale(1);
}

.map-dialog-card header,
.map-action-card header,
.map-place-dialog-card header,
.map-rule-dialog-card header,
.map-relation-dialog-card header {
  display: grid;
  gap: 4px;
}

.map-dialog-card h2,
.map-dialog-card p,
.map-action-card h2,
.map-action-card p,
.map-place-dialog-card h2,
.map-place-dialog-card p,
.map-rule-dialog-card h2,
.map-rule-dialog-card p,
.map-relation-dialog-card h2,
.map-relation-dialog-card p {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.map-dialog-card h2,
.map-action-card h2,
.map-place-dialog-card h2,
.map-rule-dialog-card h2,
.map-relation-dialog-card h2 {
  color: #111;
  font-size: 17px;
  font-weight: 620;
  line-height: 1.25;
}

.map-dialog-card header p,
.map-action-card header p,
.map-place-dialog-card header p,
.map-rule-dialog-card header p,
.map-relation-dialog-card header p {
  color: rgba(0, 0, 0, .48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.map-relation-dialog-card {
  border-radius: 4px;
  background: rgba(250, 250, 249, .72);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .78),
    inset -1px -1px 2px rgba(0, 0, 0, .12);
}

.map-relation-dialog-card header {
  grid-template-columns: 1fr;
}

.map-relation-dialog-kicker {
  display: inline-grid;
  justify-self: start;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  color: rgba(0, 0, 0, .62);
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 4px;
  background: rgba(229, 229, 226, .58);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .06em;
  line-height: 1;
}

.map-relation-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .075);
  border-radius: 4px;
  background: rgba(255, 255, 255, .38);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .70),
    inset -1px -1px 2px rgba(0, 0, 0, .10);
}

.map-relation-pair strong,
.map-relation-pair span {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.map-relation-pair span {
  color: rgba(0, 0, 0, .46);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

.map-relation-toggle-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 50px;
  padding: 10px 11px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .075);
  border-radius: 4px;
  background: rgba(255, 255, 255, .38);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .70),
    inset -1px -1px 2px rgba(0, 0, 0, .10);
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.map-relation-toggle-field span,
.map-relation-toggle-field strong,
.map-relation-toggle-field small {
  display: block;
  min-width: 0;
}

.map-relation-toggle-field strong {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.map-relation-toggle-field small {
  margin-top: 3px;
  color: rgba(0, 0, 0, .48);
  font-size: 11px;
  line-height: 1.35;
}

.map-relation-toggle-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-relation-toggle-field i {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #111;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, .26),
    inset -1px -1px 3px rgba(0, 0, 0, .22);
}

.map-relation-toggle-field i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 21px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
  transition: transform .16s ease;
}

.map-relation-toggle-field input:not(:checked) + i {
  background: rgba(0, 0, 0, .16);
}

.map-relation-toggle-field input:not(:checked) + i::after {
  transform: translateX(-18px);
}

.map-relation-dialog-card .map-field input,
.map-relation-dialog-card .map-field textarea {
  border-radius: 4px;
  background: rgba(255, 255, 255, .46);
}

.map-relation-dialog-card .map-field textarea {
  min-height: 88px;
}

.map-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #111;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  line-height: 1.3;
}

.map-field > span {
  color: rgba(0, 0, 0, .62);
  font-weight: 600;
}

.map-field input,
.map-field select,
.map-field button,
.map-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, .76);
  font: inherit;
}

.map-field .map-weather-location-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 28px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background:
    linear-gradient(45deg, transparent 50%, currentColor 50%) right 10px center / 5px 5px no-repeat,
    linear-gradient(135deg, currentColor 50%, transparent 50%) right 6px center / 5px 5px no-repeat,
    rgba(255, 255, 255, .76);
}

.map-field textarea {
  min-height: 104px;
  padding-block: 10px;
  resize: vertical;
  line-height: 1.5;
}

.map-field input:focus,
.map-field select:focus,
.map-field textarea:focus {
  border-color: rgba(0, 0, 0, .35);
}

.map-date-field input[type="hidden"] {
  display: none;
}

.map-date-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  text-align: left;
  cursor: pointer;
}

.map-date-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.map-date-button i {
  width: 8px;
  height: 8px;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.map-date-popover {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 16;
  display: grid;
  gap: 12px;
  width: min(330px, calc(100% - 44px));
  padding: 14px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 8px;
  background: rgba(250, 250, 249, .98);
  box-shadow: none;
  font-family: "Noto Serif SC", "Songti SC", serif;
  transform: translate(-50%, -50%);
}

.map-date-popover[hidden] {
  display: none;
}

.map-date-popover-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.map-date-heading {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.map-date-heading p,
.map-date-heading strong {
  margin: 0;
}

.map-date-heading p {
  color: rgba(0, 0, 0, .48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.map-date-heading strong {
  color: #111;
  font-size: 13px;
  font-weight: 620;
  line-height: 1;
}

.map-date-nav,
.map-date-year-button,
.map-date-year-input,
.map-date-day,
.map-date-popover-actions button {
  color: #111;
  border: 1px solid rgba(0, 0, 0, .085);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
  box-shadow: none;
  font: inherit;
}

.map-date-nav {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.map-date-nav span {
  width: 9px;
  height: 9px;
  border-left: 1.3px solid currentColor;
  border-bottom: 1.3px solid currentColor;
  transform: rotate(45deg) translate(2px, -1px);
}

.map-date-nav-next span {
  transform: rotate(-135deg) translate(2px, -1px);
}

.map-date-nav:disabled {
  color: rgba(0, 0, 0, .26);
  cursor: not-allowed;
}

.map-date-year-button,
.map-date-year-input {
  width: 88px;
  min-height: 30px;
  padding: 0 8px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.map-date-year-button {
  cursor: text;
}

.map-date-year-input {
  outline: none;
}

.map-date-weekdays,
.map-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.map-date-weekdays span {
  color: rgba(0, 0, 0, .45);
  text-align: center;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.map-date-day,
.map-date-day-spacer {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 32px;
}

.map-date-day {
  cursor: pointer;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.map-date-day[data-today="true"] {
  border-color: rgba(0, 0, 0, .24);
}

.map-date-day[aria-selected="true"] {
  color: #fff;
  border-color: #111;
  background: #111;
  box-shadow: none;
}

.map-date-popover-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
}

.map-date-popover-actions button {
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

.map-date-popover-actions button:last-child {
  color: #fff;
  background: #111;
}

.map-date-button:focus-visible,
.map-date-nav:focus-visible,
.map-date-year-button:focus-visible,
.map-date-year-input:focus,
.map-date-day:focus-visible,
.map-date-popover-actions button:focus-visible {
  outline: none;
  border-color: rgba(0, 0, 0, .35);
}

.map-time-sync-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 11px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .085);
  border-radius: 8px;
  background: rgba(255, 255, 255, .54);
  box-shadow: none;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.map-time-sync-field span,
.map-time-sync-field strong,
.map-time-sync-field small {
  display: block;
  min-width: 0;
}

.map-time-sync-field strong {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.map-time-sync-field small {
  margin-top: 3px;
  color: rgba(0, 0, 0, .48);
  font-size: 11px;
  line-height: 1.35;
}

.map-time-sync-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-time-sync-field i {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #111;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, .26),
    inset -1px -1px 3px rgba(0, 0, 0, .22);
}

.map-time-sync-field i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 21px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
  transition: transform .16s ease;
}

.map-time-sync-field input:not(:checked) + i {
  background: rgba(0, 0, 0, .16);
}

.map-time-sync-field input:not(:checked) + i::after {
  transform: translateX(-18px);
}

.map-rule-toggle-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 48px;
  padding: 10px 11px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .085);
  border-radius: 8px;
  background: rgba(255, 255, 255, .54);
  box-shadow: none;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.map-rule-toggle-field span,
.map-rule-toggle-field strong {
  display: block;
  min-width: 0;
}

.map-rule-toggle-field strong {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.map-rule-toggle-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-rule-toggle-field i {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #111;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, .26),
    inset -1px -1px 3px rgba(0, 0, 0, .22);
}

.map-rule-toggle-field i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 21px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
  transition: transform .16s ease;
}

.map-rule-toggle-field input:not(:checked) + i {
  background: rgba(0, 0, 0, .16);
}

.map-rule-toggle-field input:not(:checked) + i::after {
  transform: translateX(-18px);
}

.map-rule-keyword-field[hidden] {
  display: none;
}

.map-rule-range-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-rule-range-field b {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.map-rule-range-field input[type="range"] {
  height: 30px;
  padding: 0;
  accent-color: #111;
  background: transparent;
  box-shadow: none;
}

.map-rule-segment-field {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 0;
  border: 0;
}

.map-rule-scope-field {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.map-rule-segment-field legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: #111;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  font-weight: 600;
}

.map-rule-segment-field label {
  position: relative;
  min-width: 0;
}

.map-rule-segment-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-rule-segment-field span {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 8px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(0, 0, 0, .075);
  border-radius: 999px;
  color: rgba(0, 0, 0, .58);
  background: rgba(255, 255, 255, .24);
  box-shadow: none;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.map-rule-segment-field input:checked + span {
  color: #111;
  background: rgba(255, 255, 255, .66);
}

.map-preview {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(148px, 24dvh, 190px);
  overflow: hidden;
  color: inherit;
  cursor: pointer;
}

.map-preview span {
  color: rgba(0, 0, 0, .42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.map-preview[data-map-image-kind="grid"],
.map-grid-visual,
.map-detail-world[data-map-image-kind="grid"] {
  background-color: #f4f4f2;
  background-image:
    linear-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .035) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .07) 1px, transparent 1px);
  background-position: center;
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
}

.map-grid-visual {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  overflow: hidden;
}

.map-card-place-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.map-card-place-pin {
  position: absolute;
  width: 0;
  height: 0;
  color: #111;
}

.map-card-place-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 15px;
  height: 15px;
  border-radius: 50% 50% 50% 0;
  background: #111;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .64);
  transform: translate(-50%, -100%) rotate(-45deg);
}

.map-card-place-marker::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.map-card-place-label {
  position: absolute;
  left: 0;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  gap: 4px;
  max-width: 112px;
  min-height: 22px;
  padding: 3px 7px 3px 5px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
  color: #171717;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}

.map-card-place-pin[data-align-x="left"] .map-card-place-label {
  transform: translateX(8px);
}

.map-card-place-pin[data-align-x="right"] .map-card-place-label {
  transform: translateX(calc(-100% - 8px));
}

.map-card-place-pin[data-align-y="top"] .map-card-place-label {
  top: 8px;
  bottom: auto;
}

.map-card-place-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-card-place-avatar {
  display: grid;
  box-sizing: border-box;
  flex: 0 0 18px;
  place-items: center;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 50%;
  background: #ece8dd;
  color: #1f1f1f;
  font-size: 9px;
  font-weight: 820;
  line-height: 1;
}

.map-card-place-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: inherit;
  object-fit: cover;
  animation: none;
  transform: none;
}

.map-detail-world[data-map-image-kind="grid"]::before,
.map-detail-world[data-map-image-kind="grid"]::after {
  position: absolute;
  z-index: 1;
  color: rgba(0, 0, 0, .38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  pointer-events: none;
}

.map-detail-world[data-map-image-kind="grid"]::before {
  content: "X 0-100";
  top: 12px;
  left: 14px;
}

.map-detail-world[data-map-image-kind="grid"]::after {
  content: "Y 0-100";
  right: 14px;
  bottom: 12px;
}

.map-upload-grid {
  display: grid;
  grid-template-columns: minmax(118px, .44fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

#mapUploadControls {
  grid-template-columns: minmax(108px, .34fr) minmax(112px, .34fr) minmax(0, 1fr);
}

.map-upload-grid[hidden] {
  display: none;
}

.map-ai-generate-button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 14px;
  color: #fff;
  border: 1px solid #111;
  border-radius: 8px;
  background: #111;
  box-shadow: none;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.map-ai-generate-button:disabled {
  color: rgba(255, 255, 255, .68);
  cursor: wait;
}

.map-ai-generate-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .18);
}

.map-ai-card select {
  cursor: pointer;
}

.map-type-dropdown {
  position: relative;
}

.map-type-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
  box-shadow: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.map-type-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-type-button i {
  width: 8px;
  height: 8px;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.map-type-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 3;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 8px;
  background: rgba(250, 250, 249, .98);
  box-shadow: none;
}

.map-type-menu[hidden] {
  display: none;
}

.map-type-menu button {
  min-height: 34px;
  padding: 0 10px;
  color: #111;
  border-radius: 8px;
  text-align: left;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  cursor: pointer;
}

.map-type-menu button[aria-selected="true"] {
  background: rgba(0, 0, 0, .065);
  box-shadow: none;
}

.map-place-pin-mark,
.map-card-place-marker,
.map-place-icon-swatch,
.map-place-icon-preview-marker {
  box-sizing: border-box;
  --map-place-icon-fill: #111;
  --map-place-icon-core: #fff;
  --map-place-icon-ring: transparent;
  background: var(--map-place-icon-fill);
}

.map-place-pin-mark::after,
.map-card-place-marker::after,
.map-place-icon-swatch::after,
.map-place-icon-preview-marker::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--map-place-icon-core);
}

.map-place-pin-mark::after {
  inset: 8px;
}

.map-card-place-marker::after,
.map-place-icon-swatch::after {
  inset: 4px;
}

.map-place-icon-preview-marker::after {
  inset: 12px;
}

.map-place-pin-mark[data-place-icon="white"],
.map-card-place-marker[data-place-icon="white"],
.map-place-icon-swatch[data-place-icon="white"],
.map-place-icon-preview-marker[data-place-icon="white"] {
  --map-place-icon-fill: #fff;
  --map-place-icon-core: #111;
  --map-place-icon-ring: rgba(17, 17, 17, .26);
  box-shadow: 0 0 0 1px var(--map-place-icon-ring);
}

.map-card-place-marker[data-place-icon="white"] {
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .14);
}

.map-place-pin-mark[data-place-icon="transparent"],
.map-card-place-marker[data-place-icon="transparent"],
.map-place-icon-swatch[data-place-icon="transparent"],
.map-place-icon-preview-marker[data-place-icon="transparent"] {
  --map-place-icon-fill: rgba(255, 255, 255, .16);
  --map-place-icon-core: transparent;
  --map-place-icon-ring: rgba(17, 17, 17, .72);
  border: 1.5px solid var(--map-place-icon-ring);
  backdrop-filter: blur(2px);
}

.map-place-pin-mark[data-place-icon="transparent"]::after,
.map-card-place-marker[data-place-icon="transparent"]::after,
.map-place-icon-swatch[data-place-icon="transparent"]::after,
.map-place-icon-preview-marker[data-place-icon="transparent"]::after {
  border: 1.5px solid var(--map-place-icon-ring);
}

.map-place-pin-mark[data-place-icon="custom"],
.map-card-place-marker[data-place-icon="custom"],
.map-place-icon-swatch[data-place-icon="custom"],
.map-place-icon-preview-marker[data-place-icon="custom"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.map-place-pin-mark[data-place-icon="custom"] {
  transform: none;
}

.map-card-place-marker[data-place-icon="custom"] {
  transform: translate(-50%, -100%);
}

.map-place-icon-swatch[data-place-icon="custom"],
.map-place-icon-preview-marker[data-place-icon="custom"] {
  transform: none;
}

.map-place-pin-mark[data-place-icon="custom"]::after,
.map-card-place-marker[data-place-icon="custom"]::after,
.map-place-icon-swatch[data-place-icon="custom"]::after,
.map-place-icon-preview-marker[data-place-icon="custom"]::after {
  content: none;
}

.map-place-pin-mark[data-place-icon="custom"][data-place-icon-content="empty"]::before,
.map-card-place-marker[data-place-icon="custom"][data-place-icon-content="empty"]::before,
.map-place-icon-swatch[data-place-icon="custom"][data-place-icon-content="empty"]::before,
.map-place-icon-preview-marker[data-place-icon="custom"][data-place-icon-content="empty"]::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px dashed rgba(17, 17, 17, .42);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, .18), transparent 48%),
    linear-gradient(315deg, rgba(17, 17, 17, .10), transparent 52%);
}

.map-place-custom-icon-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, .14);
  overflow: hidden;
}

.map-place-custom-icon-face:empty {
  border: 1px dashed rgba(17, 17, 17, .42);
  background:
    linear-gradient(135deg, rgba(17, 17, 17, .18), transparent 48%),
    linear-gradient(315deg, rgba(17, 17, 17, .10), transparent 52%);
}

.map-place-custom-icon-face img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: inherit;
  object-fit: cover;
  animation: none;
  transform: none;
}

.map-place-icon-field {
  overflow: visible;
}

.map-place-icon-picker {
  position: relative;
}

.map-place-icon-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: #111;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
  box-shadow: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.map-place-icon-button > span:not(.map-place-icon-swatch) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-place-icon-button > i {
  width: 8px;
  height: 8px;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.map-place-icon-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 8;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 8px;
  background: rgba(250, 250, 249, .98);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .12);
}

.map-place-icon-menu[hidden] {
  display: none;
}

.map-place-icon-menu button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  color: #111;
  border-radius: 8px;
  text-align: left;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  cursor: pointer;
}

.map-place-icon-menu button[aria-selected="true"] {
  background: rgba(0, 0, 0, .065);
  box-shadow: none;
}

.map-place-icon-swatch {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.map-place-icon-custom-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, .075);
  border-radius: 8px;
  background: rgba(255, 255, 255, .32);
}

.map-place-icon-custom-panel[hidden] {
  display: none;
}

.map-place-icon-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.map-place-icon-preview-card > span {
  color: rgba(0, 0, 0, .58);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  font-weight: 650;
}

.map-place-icon-preview {
  display: grid;
  place-items: center;
  width: 72px;
  height: 58px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(0, 0, 0, .04) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .04) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, .04) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .04) 75%);
  background-position: 0 0, 7px 7px;
  background-size: 14px 14px;
}

.map-place-icon-preview-marker {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.map-place-icon-upload-grid {
  grid-template-columns: minmax(108px, .5fr) minmax(108px, .5fr);
}

.map-place-icon-upload-grid .map-url-field {
  grid-column: 1 / -1;
}

.map-place-icon-css-field textarea {
  min-height: 92px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.45;
}

.map-residents-field {
  gap: 8px;
}

.map-resident-list {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 2px 9px;
  scrollbar-width: none;
}

.map-resident-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.map-resident-list:empty {
  display: none;
}

.map-resident-option {
  flex: 0 0 72px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  min-width: 0;
  min-height: 92px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #111;
  background: transparent;
  font-family: "Noto Serif SC", "Songti SC", serif;
  line-height: 1.15;
  cursor: pointer;
}

.map-resident-option[aria-pressed="true"] {
  border-color: rgba(17, 17, 17, .24);
  background: rgba(0, 0, 0, .045);
}

.map-resident-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  color: rgba(17, 17, 17, .72);
  border: 2px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: rgba(255, 255, 255, .76);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 760;
}

.map-resident-option[aria-pressed="true"] .map-resident-avatar {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .12);
}

.map-resident-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-resident-option > span,
.map-resident-option > small {
  max-width: 64px;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-resident-option > span {
  font-size: 12px;
  font-weight: 650;
}

.map-resident-option > small {
  color: rgba(0, 0, 0, .46);
  font-size: 10px;
  font-weight: 650;
}

.map-resident-empty {
  color: rgba(0, 0, 0, .48);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  line-height: 1.35;
}

.map-upload-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  color: #111;
  background: rgba(255, 255, 255, .54);
  box-shadow: none;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.map-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.map-url-field div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.map-url-field button,
.map-dialog-actions button {
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 8px;
  color: #111;
  background: rgba(0, 0, 0, .055);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.map-form-status {
  min-height: 18px;
  margin: 0;
  color: rgba(0, 0, 0, .58);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  line-height: 1.4;
}

.map-form-status[data-tone="error"] {
  color: #9b1c1c;
}

.map-form-status[data-tone="success"] {
  color: #166534;
}

.map-dialog-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
}

.map-dialog-actions > span {
  flex: 1 1 auto;
}

.map-dialog-actions button[type="submit"] {
  color: #fff;
  background: #111;
}

.map-dialog-actions .map-danger-action {
  color: #fff;
  background: #8f1d1d;
}

html.night-mode .map-back,
html.night-mode .map-add,
html.night-mode .map-title,
html.night-mode .map-empty strong,
html.night-mode .map-dialog-card h2,
html.night-mode .map-action-card h2,
html.night-mode .map-field,
html.night-mode .map-upload-button,
html.night-mode .map-type-button,
html.night-mode .map-type-menu button,
html.night-mode .map-url-field button,
html.night-mode .map-date-button,
html.night-mode .map-date-popover,
html.night-mode .map-date-heading strong,
html.night-mode .map-date-nav,
html.night-mode .map-date-year-button,
html.night-mode .map-date-year-input,
html.night-mode .map-date-day,
html.night-mode .map-date-popover-actions button,
html.night-mode .map-enter-button,
html.night-mode .map-time-sync-field,
html.night-mode .map-dialog-actions button {
  color: var(--ink);
}

html.night-mode .map-empty,
html.night-mode .map-title-meta small,
html.night-mode .map-world-type-tag,
html.night-mode .map-time-label,
html.night-mode .map-weather-label,
html.night-mode .map-dialog-card header p,
html.night-mode .map-action-card header p,
html.night-mode .map-field > span,
html.night-mode .map-date-heading p,
html.night-mode .map-date-weekdays span,
html.night-mode .map-time-sync-field small,
html.night-mode .map-form-status,
html.night-mode .map-preview span {
  color: rgba(241, 238, 231, .58);
}

html.night-mode .map-preview,
html.night-mode .map-dialog-card,
html.night-mode .map-action-card,
html.night-mode .map-type-button,
html.night-mode .map-type-menu,
html.night-mode .map-date-button,
html.night-mode .map-date-popover,
html.night-mode .map-date-nav,
html.night-mode .map-date-year-button,
html.night-mode .map-date-year-input,
html.night-mode .map-date-day,
html.night-mode .map-date-popover-actions button,
html.night-mode .map-upload-button,
html.night-mode .map-time-sync-field {
  border-color: rgba(255, 255, 255, .10);
  background-color: rgba(255, 255, 255, .055);
  box-shadow: none;
}

html.night-mode .map-title,
html.night-mode .map-empty,
html.night-mode .map-image-frame {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

html.night-mode .map-card-meta {
  border-color: transparent;
  background: rgba(255, 255, 255, .055);
  box-shadow: none;
}

html.night-mode .map-enter-button {
  background: rgba(255, 255, 255, .055);
}

html.night-mode .map-saved-name {
  text-shadow: 0 1px 12px rgba(0, 0, 0, .36);
}

html.night-mode .map-card {
  color: var(--ink);
  background: transparent;
}

html.night-mode .map-image-frame:focus-visible {
  outline-color: rgba(241, 238, 231, .42);
}

html.night-mode .map-time-sync-field i {
  background: var(--ink);
}

html.night-mode .map-time-sync-field i::after {
  background: #11100f;
}

html.night-mode .map-time-sync-field input:not(:checked) + i {
  background: rgba(255, 255, 255, .18);
}

html.night-mode .map-preview[data-map-image-kind="grid"],
html.night-mode .map-grid-visual,
html.night-mode .map-detail-world[data-map-image-kind="grid"] {
  background-color: #24231f;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
}

html.night-mode .map-card-place-marker {
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 16, 15, .62);
}

html.night-mode .map-card-place-marker::after {
  background: #11100f;
}

html.night-mode .map-card-place-label {
  border-color: rgba(241, 238, 231, .16);
  background: rgba(17, 16, 15, .88);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
  color: var(--ink);
}

html.night-mode .map-card-place-avatar {
  border-color: rgba(241, 238, 231, .2);
  background: rgba(241, 238, 231, .12);
  color: var(--ink);
}

html.night-mode .map-date-nav:disabled {
  color: rgba(241, 238, 231, .34);
}

html.night-mode .map-date-day[data-today="true"] {
  border-color: rgba(241, 238, 231, .34);
}

html.night-mode .map-date-day[aria-selected="true"],
html.night-mode .map-date-popover-actions button:last-child {
  color: #11100f;
  border-color: var(--ink);
  background: var(--ink);
}

html.night-mode .map-field input,
html.night-mode .map-field select,
html.night-mode .map-field button,
html.night-mode .map-field textarea {
  color: var(--ink);
  border-color: rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .07);
}

html.night-mode .map-resident-option {
  color: var(--ink);
  background: transparent;
}

html.night-mode .map-resident-option[aria-pressed="true"] {
  border-color: rgba(241, 238, 231, .30);
  background: rgba(255, 255, 255, .075);
}

html.night-mode .map-resident-avatar {
  color: rgba(241, 238, 231, .72);
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
}

html.night-mode .map-resident-option[aria-pressed="true"] .map-resident-avatar {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(241, 238, 231, .14);
}

html.night-mode .map-resident-option > small {
  color: rgba(241, 238, 231, .50);
}

html.night-mode .map-field .map-weather-location-button {
  background:
    linear-gradient(45deg, transparent 50%, currentColor 50%) right 10px center / 5px 5px no-repeat,
    linear-gradient(135deg, currentColor 50%, transparent 50%) right 6px center / 5px 5px no-repeat,
    rgba(255, 255, 255, .07);
}

html.night-mode .map-field input:focus,
html.night-mode .map-field select:focus,
html.night-mode .map-field textarea:focus,
html.night-mode .map-date-button:focus-visible,
html.night-mode .map-date-nav:focus-visible,
html.night-mode .map-date-year-button:focus-visible,
html.night-mode .map-date-year-input:focus,
html.night-mode .map-date-day:focus-visible,
html.night-mode .map-date-popover-actions button:focus-visible {
  border-color: rgba(241, 238, 231, .42);
}

html.night-mode .map-weather-label[data-tone="error"] {
  color: #fca5a5;
}

html.night-mode .map-title-weather[data-tone="error"] {
  color: #fca5a5;
}

html.night-mode .map-url-field button,
html.night-mode .map-dialog-actions button {
  background: rgba(255, 255, 255, .09);
}

html.night-mode .map-type-menu button[aria-selected="true"] {
  background: rgba(255, 255, 255, .12);
}

html.night-mode .map-place-icon-button,
html.night-mode .map-place-icon-menu,
html.night-mode .map-place-icon-custom-panel,
html.night-mode .map-place-icon-preview {
  border-color: rgba(255, 255, 255, .10);
  background-color: rgba(255, 255, 255, .055);
}

html.night-mode .map-place-icon-button,
html.night-mode .map-place-icon-menu button {
  color: var(--ink);
}

html.night-mode .map-place-icon-menu {
  background: rgba(22, 21, 19, .98);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .28);
}

html.night-mode .map-place-icon-menu button[aria-selected="true"] {
  background: rgba(255, 255, 255, .12);
}

html.night-mode .map-place-icon-preview-card > span {
  color: rgba(241, 238, 231, .58);
}

html.night-mode .map-place-icon-preview {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .055) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .055) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .055) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .055) 75%);
}

html.night-mode .map-place-pin-mark[data-place-icon="transparent"],
html.night-mode .map-card-place-marker[data-place-icon="transparent"],
html.night-mode .map-place-icon-swatch[data-place-icon="transparent"],
html.night-mode .map-place-icon-preview-marker[data-place-icon="transparent"] {
  --map-place-icon-fill: rgba(241, 238, 231, .10);
  --map-place-icon-ring: rgba(241, 238, 231, .78);
}

html.night-mode .map-place-pin-mark[data-place-icon="custom"][data-place-icon-content="empty"]::before,
html.night-mode .map-card-place-marker[data-place-icon="custom"][data-place-icon-content="empty"]::before,
html.night-mode .map-place-icon-swatch[data-place-icon="custom"][data-place-icon-content="empty"]::before,
html.night-mode .map-place-icon-preview-marker[data-place-icon="custom"][data-place-icon-content="empty"]::before,
html.night-mode .map-place-custom-icon-face:empty {
  border-color: rgba(241, 238, 231, .42);
  background:
    linear-gradient(135deg, rgba(241, 238, 231, .18), transparent 48%),
    linear-gradient(315deg, rgba(241, 238, 231, .10), transparent 52%);
}

html.night-mode .map-dialog-actions button[type="submit"] {
  color: #11100f;
  background: var(--ink);
}

html.night-mode .map-ai-generate-button {
  color: #11100f;
  border-color: var(--ink);
  background: var(--ink);
}

html.night-mode .map-ai-generate-button:disabled {
  color: rgba(17, 16, 15, .58);
}

html.night-mode .map-dialog,
html.night-mode .map-action-dialog,
html.night-mode .map-place-dialog {
  background: rgba(17, 16, 15, .68);
}

html.night-mode .map-detail-stage {
  background: transparent;
}

html.night-mode .map-detail-stage::after {
  content: none;
}

html.night-mode .map-selected-place,
html.night-mode .map-place-pin small,
html.night-mode .map-place-dialog-card {
  border-color: rgba(255, 255, 255, .10);
  background: rgba(22, 21, 19, .82);
}

html.night-mode .map-detail-search {
  background: rgba(255, 255, 255, .06);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, .26),
    inset 1px 1px 0 rgba(255, 255, 255, .10),
    inset -1px -1px 0 rgba(0, 0, 0, .22);
}

html.night-mode .map-detail-search::before,
html.night-mode .map-detail-nav::before {
  background:
    linear-gradient(116deg, transparent 0%, transparent 10%, rgba(255, 255, 255, .16) 15%, rgba(255, 255, 255, .06) 22%, transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .13) 20%, rgba(255, 255, 255, .08) 34%, rgba(0, 0, 0, .18) 72%, rgba(0, 0, 0, .30)),
    radial-gradient(circle at 6% 8%, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06) 30%, transparent 52%),
    linear-gradient(315deg, rgba(0, 0, 0, .24), transparent 48%, rgba(255, 255, 255, .18));
}

html.night-mode .map-detail-search::after,
html.night-mode .map-detail-nav::after {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02) 24%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 58%),
    linear-gradient(90deg, rgba(255, 255, 255, .06), transparent 50%, rgba(0, 0, 0, .13));
}

html.night-mode .map-detail-nav {
  background: rgba(255, 255, 255, .055);
  box-shadow:
    0 -14px 28px rgba(0, 0, 0, .34),
    inset 1px 1px 0 rgba(255, 255, 255, .10),
    inset -1px -1px 0 rgba(0, 0, 0, .18);
}

html.night-mode .map-detail-search input,
html.night-mode .map-detail-search button,
html.night-mode .map-selected-place button,
html.night-mode .map-detail-nav button,
html.night-mode .map-detail-nav::before,
html.night-mode .map-detail-placeholder strong,
html.night-mode .map-selected-place strong,
html.night-mode .map-place-pin,
html.night-mode .map-place-pin small,
html.night-mode .map-place-dialog-card h2 {
  color: var(--ink);
}

html.night-mode .map-detail-search button,
html.night-mode .map-selected-place button {
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}

html.night-mode .map-detail-search button {
  background: transparent;
  box-shadow: none;
}

html.night-mode .map-detail-edit-toggle > span {
  color: #11100f;
  background: var(--ink);
}

html.night-mode .map-selected-place small,
html.night-mode .map-selected-place p,
html.night-mode .map-detail-placeholder small,
html.night-mode .map-detail-placeholder p,
html.night-mode .map-detail-status,
html.night-mode .map-place-dialog-card header p,
html.night-mode .map-resident-empty,
html.night-mode .map-detail-world[data-map-image-kind="grid"]::before,
html.night-mode .map-detail-world[data-map-image-kind="grid"]::after {
  color: rgba(241, 238, 231, .58);
}

html.night-mode .map-detail-nav button:not(:last-child)::after {
  content: none;
}

html.night-mode .map-detail-status[data-tone="error"] {
  color: #fca5a5;
}

html.night-mode .map-rule-panel {
  background: rgba(255, 255, 255, .04);
}

html.night-mode .map-rule-dialog {
  background: rgba(17, 16, 15, .68);
}

html.night-mode .map-rule-dialog-card,
html.night-mode .map-rule-card,
html.night-mode .map-rule-toggle-field,
html.night-mode .map-rule-segment-field span {
  border-color: rgba(255, 255, 255, .10);
  background: rgba(22, 21, 19, .82);
}

html.night-mode .map-rule-card h3,
html.night-mode .map-rule-dialog-card h2,
html.night-mode .map-rule-toggle-field strong,
html.night-mode .map-rule-segment-field legend,
html.night-mode .map-rule-segment-field input:checked + span {
  color: var(--ink);
}

html.night-mode .map-rule-empty,
html.night-mode .map-rule-meta span,
html.night-mode .map-rule-content,
html.night-mode .map-rule-dialog-card header p {
  color: rgba(241, 238, 231, .58);
}

html.night-mode .map-rule-meta span {
  border-color: rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .075);
}

html.night-mode .map-rule-keyword-chip,
html.night-mode .map-rule-segment-field input:checked + span {
  background: rgba(255, 255, 255, .13) !important;
}

html.night-mode .map-rule-toggle-field i,
html.night-mode .map-rule-entry-switch span {
  background: var(--ink);
}

html.night-mode .map-rule-toggle-field i::after,
html.night-mode .map-rule-entry-switch span::after {
  background: #11100f;
}

html.night-mode .map-rule-toggle-field input:not(:checked) + i,
html.night-mode .map-rule-entry-switch input:not(:checked) + span {
  background: rgba(255, 255, 255, .18);
}

html.night-mode .map-rule-range-field input[type="range"] {
  accent-color: var(--ink);
}

html.night-mode .map-header-relation-avatar {
  color: var(--ink);
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .12),
    inset -1px -1px 2px rgba(0, 0, 0, .32);
}

html.night-mode .map-relation-focus-menu {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(22, 21, 19, .78);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, .30),
    inset 1px 1px 1px rgba(255, 255, 255, .10),
    inset -1px -1px 2px rgba(0, 0, 0, .28);
}

html.night-mode .map-relation-focus-menu button {
  color: var(--ink);
}

html.night-mode .map-relation-focus-menu button[aria-checked="true"] {
  border-color: rgba(241, 238, 231, .18);
  background: rgba(255, 255, 255, .09);
}

html.night-mode .map-relation-focus-menu small {
  color: rgba(241, 238, 231, .54);
}

html.night-mode .map-relation-focus-avatar {
  color: rgba(241, 238, 231, .72);
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
}

html.night-mode .map-detail-world[data-map-image-kind="relations"] {
  background: transparent;
}

html.night-mode .map-relation-edge-layer marker path {
  fill: rgba(190, 190, 190, .86);
}

html.night-mode .map-relation-edge {
  stroke: rgba(190, 190, 190, .72);
}

html.night-mode .map-relation-label {
  color: rgba(241, 238, 231, .70);
  border-color: rgba(255, 255, 255, .12);
  background: rgba(22, 21, 19, .66);
  box-shadow:
    inset 1px 1px 1px rgba(255, 255, 255, .10),
    inset -1px -1px 2px rgba(0, 0, 0, .24);
}

html.night-mode .map-relation-card,
html.night-mode .map-relation-dialog-card,
html.night-mode .map-relation-pair,
html.night-mode .map-relation-toggle-field {
  color: var(--ink);
  border-color: rgba(255, 255, 255, .12);
  background: rgba(22, 21, 19, .72);
  box-shadow:
    0 14px 24px rgba(0, 0, 0, .24),
    inset 1px 1px 1px rgba(255, 255, 255, .10),
    inset -1px -1px 2px rgba(0, 0, 0, .28);
}

html.night-mode .map-relation-card[aria-pressed="true"] {
  border-color: rgba(241, 238, 231, .68);
}

html.night-mode .map-relation-photo {
  color: rgba(241, 238, 231, .72);
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
}

html.night-mode .map-relation-card small,
html.night-mode .map-relation-empty,
html.night-mode .map-relation-hint,
html.night-mode .map-relation-pair span,
html.night-mode .map-relation-toggle-field small,
html.night-mode .map-relation-dialog-kicker {
  color: rgba(241, 238, 231, .58);
}

html.night-mode .map-relation-dialog-kicker {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
}

html.night-mode .map-relation-toggle-field i {
  background: var(--ink);
}

html.night-mode .map-relation-toggle-field i::after {
  background: #11100f;
}

html.night-mode .map-relation-toggle-field input:not(:checked) + i {
  background: rgba(255, 255, 255, .18);
}

html.night-mode .map-relation-dialog {
  background: rgba(17, 16, 15, .68);
}

@media (max-width: 720px) {
  .map-saved-list {
    gap: 20px;
  }
}

@media (max-width: 380px) {
  .map-page {
    padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
  }

  .map-image-frame {
    padding: 12px;
  }

  .map-image-frame::before {
    inset: 0;
  }

  .map-upload-grid,
  #mapUploadControls {
    grid-template-columns: 1fr;
  }

  .map-selected-place {
    grid-template-columns: 76px minmax(0, 1fr) 38px;
    gap: 9px;
    min-height: 96px;
  }

  .map-selected-place img {
    width: 76px;
    height: 76px;
  }

  .map-detail-nav button span {
    max-width: 58px;
    font-size: 10px;
  }

  .map-title {
    column-gap: 6px;
    padding-inline: 4px;
  }

  .map-page[data-view="detail"] .map-title > #mapTitleText {
    max-width: 32vw;
  }

  .map-title-meta {
    max-width: 30vw;
  }

  .map-title-meta small {
    font-size: 9px;
  }

  .map-detail-edit-toggle > span {
    width: 54px;
    height: 54px;
  }

  .map-relation-card {
    width: 102px;
    min-height: 134px;
    padding: 7px 7px 10px;
  }

  .map-relation-photo {
    width: 82px;
    height: 82px;
  }

  .map-relation-card strong {
    font-size: 12px;
  }
}

.map-header {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.map-header-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 2px;
  min-width: 44px;
}

.map-relation-settings-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.map-relation-settings-button[hidden] {
  display: none;
}

.map-relation-settings-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-relation-settings-button:focus-visible {
  outline: 1px solid rgba(0, 0, 0, .34);
  outline-offset: 2px;
}

.map-relation-settings-button:active {
  transform: translateY(2px) scale(.94);
}

.map-relation-focus-menu {
  right: 46px;
}

.map-relation-settings-card {
  width: min(100%, 410px);
}

.map-relation-auto-update-panel {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.map-relation-auto-update-panel[hidden] {
  display: none;
}

.map-relation-api-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-top: 2px;
}

.map-relation-api-heading strong,
.map-relation-api-heading small,
.map-relation-model-field > small,
.map-relation-update-history {
  min-width: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.map-relation-api-heading strong {
  color: #111;
  font-size: 12px;
  font-weight: 650;
}

.map-relation-api-heading small,
.map-relation-model-field > small,
.map-relation-update-history {
  color: rgba(0, 0, 0, .48);
  font-size: 10px;
  line-height: 1.4;
}

.map-relation-api-heading small {
  text-align: right;
}

.map-relation-model-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  min-width: 0;
}

.map-relation-model-row button {
  width: 96px;
  padding-inline: 8px;
  background: rgba(0, 0, 0, .055);
  cursor: pointer;
}

.map-relation-model-row button:disabled {
  cursor: default;
  opacity: .52;
}

.map-relation-interval-field > div {
  display: grid;
  grid-template-columns: auto 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.map-relation-interval-field > div > span {
  color: rgba(0, 0, 0, .58);
  white-space: nowrap;
}

.map-relation-interval-field input {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.map-relation-update-history {
  min-height: 15px;
  margin: 0;
}

.map-relation-update-history[data-tone="error"] {
  color: #9b1c1c;
}

html.night-mode .map-relation-settings-button,
html.night-mode .map-relation-api-heading strong {
  color: var(--ink);
}

html.night-mode .map-relation-settings-button:focus-visible {
  outline-color: rgba(241, 238, 231, .42);
}

html.night-mode .map-relation-api-heading small,
html.night-mode .map-relation-model-field > small,
html.night-mode .map-relation-interval-field > div > span,
html.night-mode .map-relation-update-history {
  color: rgba(241, 238, 231, .58);
}

html.night-mode .map-relation-model-row button {
  background: rgba(255, 255, 255, .09);
}

html.night-mode .map-relation-update-history[data-tone="error"] {
  color: #fca5a5;
}

@media (max-width: 380px) {
  .map-header-actions {
    gap: 0;
  }

  .map-relation-model-row {
    grid-template-columns: 1fr;
  }

  .map-relation-model-row button {
    width: 100%;
  }
}
