/* UN 创造服地图 —— 共用样式（浅色、UN 蓝） */
:root {
  --ink: #0b2236;
  --text: #3c5166;
  --mute: #6c7f92;
  --line: rgba(11, 34, 54, .1);
  --un: #009edb;
  --deep: #0a6aa8;
  --glass: rgba(255, 255, 255, .74);
  --glass-strong: rgba(255, 255, 255, .9);
  --shadow: 0 10px 30px -12px rgba(11, 34, 54, .28), 0 1px 2px rgba(11, 34, 54, .08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; background: #eaf4fb; overflow: hidden; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--un); outline-offset: 2px; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
}

/* ---------------- 3D ---------------- */
#app3d { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#app3d[data-mode="street"] #view { cursor: grab; }
#app3d[data-mode="street"] #view:active { cursor: grabbing; }

.p3-top { position: absolute; left: 16px; right: 16px; top: max(16px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.p3-top > * { pointer-events: auto; }
.p3-back, .p3-list-btn, .p3-title {
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow);
}
.p3-back, .p3-list-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .3s var(--ease), transform .3s var(--ease);
}
.p3-back:hover, .p3-list-btn:hover { background: var(--glass-strong); transform: translateY(-1px); }
.p3-list-btn { margin-left: auto; }
.p3-title { display: flex; flex-direction: column; justify-content: center; height: 44px; padding: 0 16px; border-radius: 14px; min-width: 0; }
.p3-title h1 { margin: 0; font-size: 15px; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p3-title p { margin: 1px 0 0; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }

.p3-sheet {
  position: absolute; top: max(70px, calc(env(safe-area-inset-top) + 54px)); right: 16px; width: 300px; max-height: calc(100% - 170px);
  overflow: auto; padding: 6px; border-radius: 18px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
#app3d.list-open .p3-sheet { opacity: 1; transform: none; pointer-events: auto; }
.p3-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; transition: background .25s; }
.p3-item:hover { background: rgba(0, 158, 219, .08); }
.p3-item.is-on { background: rgba(0, 158, 219, .14); }
.p3-item img { width: 52px; height: 38px; flex: none; border-radius: 8px; object-fit: cover; background: #dfe8ef; }
.p3-item span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.p3-item strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p3-item small { font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; }

.p3-modes {
  position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; padding: 4px; border-radius: 999px; background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow);
}
.p3-modes button { height: 42px; min-width: 88px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .35s var(--ease), color .35s var(--ease); }
.p3-modes button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.p3-corner { position: absolute; left: 16px; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; pointer-events: none; }
.p3-mini { display: none; width: 184px; height: 184px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 3px rgba(255, 255, 255, .9); pointer-events: auto; cursor: pointer; }
#app3d.has-mini .p3-mini { display: block; }
.p3-mini canvas { display: block; width: 100%; height: 100%; }
.p3-hint { margin: 0; padding: 7px 12px; border-radius: 12px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); max-width: 34ch; font-size: 12.5px; line-height: 1.5; color: var(--text); }

.p3-hud { position: absolute; right: 16px; bottom: max(22px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); white-space: pre; }
.p3-compass { position: relative; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.p3-compass i { position: absolute; inset: 4px; }
.p3-compass i::before { content: ""; position: absolute; left: 50%; top: 0; margin-left: -4px; border: 4px solid transparent; border-bottom: 11px solid #e0524c; border-top: 0; }
.p3-compass i::after { content: ""; position: absolute; left: 50%; bottom: 0; margin-left: -4px; border: 4px solid transparent; border-top: 11px solid #9aa9b8; border-bottom: 0; }

.p3-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #dcebf6; transition: opacity .6s var(--ease); overflow: hidden; }
.p3-loading::before { content: ""; position: absolute; inset: -40px; background: var(--thumb, none) center / cover no-repeat; filter: blur(18px) saturate(1.1); opacity: .75; transform: scale(1.06); }
.p3-loading.is-done { opacity: 0; pointer-events: none; }
.p3-loading[hidden] { display: none; }
.p3-loading-card { position: relative; width: min(320px, 80vw); padding: 22px 22px 18px; border-radius: 20px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.p3-loading .msg { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.p3-loading .bar { height: 6px; border-radius: 99px; background: rgba(11, 34, 54, .08); overflow: hidden; }
.p3-loading .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--deep), var(--un)); transform-origin: 0 50%; transform: scaleX(.04); transition: transform .3s var(--ease); }
.p3-loading .size { margin: 10px 0 0; font-size: 12px; color: var(--mute); }

#app3d.is-shot .p3-top, #app3d.is-shot .p3-modes, #app3d.is-shot .p3-corner, #app3d.is-shot .p3-hud { display: none; }

@media (max-width: 640px) {
  .p3-top { left: 10px; right: 10px; gap: 8px; }
  .p3-back span, .p3-list-btn span { display: none; }
  .p3-back, .p3-list-btn { width: 44px; padding: 0; justify-content: center; }
  .p3-title { flex: 1; }
  .p3-sheet { left: 10px; right: 10px; width: auto; }
  .p3-hint { display: none; }
  .p3-corner { left: 10px; bottom: calc(max(22px, env(safe-area-inset-bottom)) + 60px); }
  .p3-mini { width: 112px; height: 112px; border-radius: 16px; }
  .p3-hud { right: 10px; bottom: calc(max(22px, env(safe-area-inset-bottom)) + 60px); font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------- 2D map ---------------- */
#app2d { position: fixed; inset: 0; background: #e7edf2; }

.m-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.m-pin {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; height: 24px; margin: -12px 0 0 -9px;
  padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; white-space: nowrap; will-change: transform;
}
.m-pin i { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--un); box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(11, 34, 54, .35); transition: transform .3s var(--ease); }
.m-pin span {
  padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(11, 34, 54, .18);
  font-size: 13px; font-weight: 600; color: var(--ink); transition: opacity .25s;
}
.m-pin[hidden] { display: none; }
.m-pin.no-label span { opacity: 0; pointer-events: none; }
.m-pin:hover i, .m-pin.is-on i { transform: scale(1.25); }
.m-pin.is-on i { background: var(--ink); }
.m-pin.is-on span { background: var(--ink); color: #fff; }
#app2d:not([data-dim="minecraft_overworld"]) .m-pins { display: none; }

.m-panel {
  position: absolute; left: 16px; top: 16px; bottom: 16px; width: 344px; display: flex; flex-direction: column;
  border-radius: 22px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: var(--shadow); overflow: hidden;
}
.m-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.m-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--un); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; text-decoration: none; }
.m-brand-text { min-width: 0; }
.m-brand h1 { margin: 0; font-size: 17px; line-height: 1.25; letter-spacing: -.01em; }
.m-brand p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--mute); }
.m-sheet-toggle { display: none; }

.m-seg { display: flex; gap: 2px; margin: 0 18px 12px; padding: 3px; border-radius: 12px; background: rgba(11, 34, 54, .06); }
.m-seg button { flex: 1; height: 32px; border: 0; border-radius: 9px; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; }
.m-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(11, 34, 54, .14); }

.m-list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 18px 8px; border-top: 1px solid var(--line); }
.m-list-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--mute); }
.m-list-head a { font-size: 12.5px; color: var(--deep); text-decoration: none; }
.m-list-head a:hover { text-decoration: underline; }
.m-list { flex: 1; overflow: auto; padding: 0 8px 10px; overscroll-behavior: contain; }
#app2d:not([data-dim="minecraft_overworld"]) .m-list-head, #app2d:not([data-dim="minecraft_overworld"]) .m-list { opacity: .45; }
.m-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; transition: background .2s; }
.m-row:hover { background: rgba(0, 158, 219, .07); }
.m-row.is-on { background: rgba(0, 158, 219, .13); }
.m-row img { width: 54px; height: 40px; flex: none; border-radius: 9px; object-fit: cover; background: #dfe8ef; }
.m-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-row-text strong { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row-text small { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.m-row-3d { flex: none; display: grid; place-items: center; height: 26px; padding: 0 9px; border-radius: 8px; background: rgba(0, 158, 219, .12); color: var(--deep); font-size: 12px; font-weight: 700; text-decoration: none; transition: background .2s, color .2s; }
.m-row-3d:hover { background: var(--un); color: #fff; }

.m-card {
  position: absolute; left: 376px; bottom: 16px; width: 340px; border-radius: 22px; overflow: hidden;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); box-shadow: 0 18px 50px -18px rgba(11, 34, 54, .45), 0 1px 2px rgba(11, 34, 54, .08);
}
.m-card[hidden] { display: none; }
.m-card.is-in { animation: cardIn .5s var(--ease); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.m-card-media { aspect-ratio: 16 / 9; background: #dfe8ef; overflow: hidden; }
.m-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-card-body { padding: 14px 18px 16px; }
.m-card h2 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
.m-card-coord { margin: 3px 0 14px; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.m-card-actions { display: flex; gap: 8px; }
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: rgba(11, 34, 54, .07); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s var(--ease); }
.m-btn:hover { background: rgba(11, 34, 54, .12); }
.m-btn:active { transform: scale(.97); }
.m-btn-primary { flex: 1; background: var(--un); color: #fff; }
.m-btn-primary:hover { background: #0090c9; }
.m-card-note { margin: 10px 0 0; font-size: 12px; color: var(--mute); }
.m-card-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .88); color: var(--ink); cursor: pointer; box-shadow: 0 2px 6px rgba(11, 34, 54, .2); }

.m-tools { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.m-tools button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; transition: background .2s; }
.m-tools button:hover { background: rgba(11, 34, 54, .07); }
.m-tools hr { width: 24px; margin: 3px auto; border: 0; border-top: 1px solid var(--line); }

.m-hud { position: absolute; right: 72px; bottom: 16px; display: flex; align-items: center; gap: 14px; height: 36px; padding: 0 14px; border-radius: 12px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.m-scale { display: inline-flex; align-items: center; gap: 7px; }
.m-scale i { display: block; width: var(--w, 80px); height: 6px; border: 2px solid var(--ink); border-top: 0; transition: width .2s; }

@media (max-width: 1060px) {
  .m-card { left: auto; right: 72px; bottom: 64px; }
}
@media (max-width: 720px) {
  .m-panel { left: 8px; right: 8px; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; max-height: 178px; border-radius: 20px; transition: max-height .45s var(--ease); }
  #app2d.sheet-open .m-panel { max-height: 72vh; }
  .m-brand { padding: 12px 12px 10px; }
  .m-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
  .m-brand h1 { font-size: 15px; }
  .m-brand p { display: none; }
  .m-sheet-toggle { display: grid; place-items: center; margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(11, 34, 54, .06); color: var(--ink); cursor: pointer; }
  .m-sheet-toggle svg { transition: transform .3s var(--ease); }
  #app2d.sheet-open .m-sheet-toggle svg { transform: rotate(180deg); }
  .m-seg { margin: 0 12px 8px; }
  .m-list-head { display: none; }
  #app2d:not(.sheet-open) .m-list { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 0 10px 10px; scroll-snap-type: x mandatory; }
  #app2d:not(.sheet-open) .m-row { flex: none; width: auto; max-width: 220px; padding: 6px 8px; background: rgba(11, 34, 54, .05); scroll-snap-align: start; }
  #app2d:not(.sheet-open) .m-row small, #app2d:not(.sheet-open) .m-row-3d { display: none; }
  #app2d:not(.sheet-open) .m-row img { width: 36px; height: 28px; border-radius: 7px; }
  #app2d:not(.sheet-open) .m-row.is-on { background: rgba(0, 158, 219, .16); }
  #app2d.sheet-open .m-list-head { display: flex; }
  .m-card { left: 8px; right: 8px; width: auto; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 186px); display: grid; grid-template-columns: 112px 1fr; }
  .m-card-media { aspect-ratio: auto; height: 100%; }
  .m-card-body { padding: 12px 14px; }
  .m-card h2 { font-size: 16px; padding-right: 26px; }
  .m-card-coord { margin-bottom: 10px; font-size: 12px; }
  .m-btn { height: 36px; padding: 0 12px; font-size: 13px; }
  .m-card-note { display: none; }
  .m-card-close { top: 8px; right: 8px; width: 28px; height: 28px; }
  #app2d.sheet-open .m-card { display: none; }
  .m-tools { top: max(10px, env(safe-area-inset-top)); bottom: auto; right: 10px; }
  .m-hud { top: max(10px, env(safe-area-inset-top)); bottom: auto; left: 10px; right: auto; height: 32px; padding: 0 12px; font-size: 11.5px; }
  .m-hud #coords { display: none; }
}

/* ---------------- one 3D map ---------------- */
#view3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#view3d.is-grabbing { cursor: grabbing; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#app2d[data-mode3d="street"] .m-pins, #app2d[data-mode3d="street"] .m-scale,
#app2d[data-mode3d="street"] #zones-legend, #app2d[data-mode3d="street"] #overlay { display: none; }
#app2d[data-mode3d="street"] #view3d:active { cursor: grabbing; }

.m-tools .m-tog3d { width: 40px; height: 34px; font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--mute); }
.m-tools .m-tog3d[aria-pressed="true"] { background: var(--un); color: #fff; }
.m-tools button[aria-pressed="true"]:not(.m-tog3d) { background: rgba(0, 158, 219, .14); color: var(--deep); }

.v3-bar { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .4s var(--ease), transform .5s var(--ease); display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow); }
#app2d[data-mode3d="street"] .v3-bar { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.v3-bar button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px 0 12px; border: 0; border-radius: 999px; background: transparent; font-size: 14.5px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease); }
.v3-hint { position: absolute; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); margin: 0; padding: 7px 14px; border-radius: 12px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); font-size: 12.5px; color: var(--text); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .6s; }
#app2d.show-hint .v3-hint { opacity: 1; }

.v3-mini { position: absolute; right: 72px; bottom: 64px; width: 184px; height: 184px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 3px rgba(255, 255, 255, .9); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .5s; }
#app2d[data-mode3d="street"] .v3-mini { opacity: 1; pointer-events: auto; }
.v3-mini canvas { display: block; width: 100%; height: 100%; }
.v3-compass { position: relative; display: inline-block; flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .3s; }
#app2d.is-turned .v3-compass { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 3px rgba(0, 158, 219, .35); }
.v3-compass i { position: absolute; inset: 3px; transition: transform .1s linear; }
.v3-compass i::before { content: ""; position: absolute; left: 50%; top: 0; margin-left: -3px; border: 3px solid transparent; border-bottom: 8px solid #e0524c; border-top: 0; }
.v3-compass i::after { content: ""; position: absolute; left: 50%; bottom: 0; margin-left: -3px; border: 3px solid transparent; border-top: 8px solid #9aa9b8; border-bottom: 0; }
.m-notice { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: min(440px, 90vw); margin: 0; padding: 16px 20px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 14px; line-height: 1.7; color: var(--ink); text-align: center; }
.m-notice[hidden] { display: none; }

.m-legend { position: absolute; top: 16px; right: 16px; width: 250px; padding: 14px 16px 12px; border-radius: 18px; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.m-legend[hidden], #app2d:not([data-dim="minecraft_overworld"]) .m-legend { display: none; }
.m-legend h2 { margin: 0 0 8px; font-size: 14px; }
.m-legend ul { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 7px; }
.m-legend li { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; font-size: 13.5px; font-weight: 600; }
.m-legend li i { grid-row: span 2; width: 18px; height: 12px; margin-top: 4px; border: 2px dashed var(--c); border-radius: 3px; }
.m-legend li small { font-size: 12px; font-weight: 400; color: var(--mute); }
.m-legend a { font-size: 12.5px; color: var(--deep); text-decoration: none; }
.m-legend a:hover { text-decoration: underline; }

.m-toast { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); margin: 0; padding: 9px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13.5px; box-shadow: var(--shadow); }
.m-toast[hidden] { display: none; }

#app2d[data-dim="minecraft_the_nether"] .v3-hint, #app2d[data-dim="minecraft_the_end"] .v3-hint { color: var(--ink); }

@media (max-width: 720px) {
  .v3-bar { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 186px); }
  .v3-hint { display: none; }
  .v3-mini { right: 10px; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 240px); width: 108px; height: 108px; border-radius: 16px; }
  .m-legend { top: 52px; left: 10px; right: auto; width: 230px; }
  #app2d[data-mode3d="street"] .m-panel { max-height: 120px; }
}
