/* Layout: the map is the whole page — a folded-paper continent (three.js) with ink creases from a
   normal+depth edge pass. Cities = categories, buildings = tools. All text lives in one corner info box. */
:root {
  --sky: #f1eadb;
  --card: #fffdf8;
  --paper: #fbf7ee;
  --road: #eee2c6;
  --kraft: #c59c6c;
  --kraft-deep: #946b43;
  --stone: #b9b3a7;
  --slate: #8d99a2;
  --snow: #fdfcf7;
  --grass: #bcc58c;
  --meadow: #d6cf8e;
  --olive: #7c8b48;
  --pine: #566a3f;
  --mustard: #e0a22b;
  --terra: #c56a42;
  --roof-slate: #6f8598;
  --wall-rose: #ecd0bf;
  --wall-sage: #d7dfc4;
  --wall-sky: #d2e0e3;
  --water: #9fbcc3;
  --water-ink: #5a7d86;
  --ink: #3a2f25;
  --ink-soft: #5b5046;
  --ink-faint: #7d7266;
  --line: #e2d8c8;
  --coral: #ff6554;
  --coral-deep: #b83d30;
  --coral-wash: #ffd9cf;
  --ui-card: #fffdf8; --ui-ink: #3a2f25; --ui-soft: #5b5046; --ui-faint: #7d7266; --ui-line: #e2d8c8; --ui-hot: #ffd9cf; --ui-water: #5a7d86; --ui-shadow: rgba(58, 47, 37, .16);
  --font-sans: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', system-ui, sans-serif;
  --font-map: 'Cormorant Garamond', 'Songti SC', 'STSong', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'PingFang SC', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { transition: background-color .8s; background: var(--sky); color: var(--ui-ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.55; overflow: hidden; }

.map { position: fixed; inset: 0; overflow: hidden; background: var(--sky); user-select: none; -webkit-user-select: none; }
.map canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.map canvas:active { cursor: grabbing; }
.map.pointing canvas { cursor: pointer; }
.map.panning canvas { cursor: move; }
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ui { z-index: 2; }

.ui { position: absolute; display: flex; gap: 6px; align-items: center; }
.map-controls { display: contents; }
.brand { top: calc(14px + env(safe-area-inset-top, 0px)); left: calc(14px + env(safe-area-inset-left, 0px)); gap: 0;
  background: var(--ui-card); border: 1px solid var(--ui-ink); border-radius: 999px; padding: 3px; }
.brand a { color: var(--ui-ink); text-decoration: none; border-radius: 999px; padding: 4px 12px; }
.brand .site { font-family: var(--font-map); font-style: italic; font-weight: 600; font-size: 18px; line-height: 1.1; }
.brand a:hover { background: var(--ui-line); }
.brand .links { display: flex; align-items: center; }
.brand .links:empty { display: none; }
.brand .links a { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ui-soft);
  border-left: 1px solid var(--ui-line); border-radius: 0; padding: 4px 10px; }
.brand .links a:last-child { border-radius: 0 999px 999px 0; }
.brand .links .ic { width: 14px; height: 14px; flex: none; }
.brand .links img.ic { object-fit: contain; }
.brand .links .ext { width: 11px; height: 11px; opacity: .6; transition: transform .2s, opacity .2s; }
.brand .links a:hover .ext { opacity: 1; transform: translate(1px, -1px); }
@media (max-width: 760px) { .brand .links a:has(.ic) .t { display: none; } .brand .links a { padding: 4px 9px; } }
.tools .sep { width: 1px; height: 16px; background: var(--ui-line); margin: 0 2px; }
.foot { left: calc(70px + env(safe-area-inset-left, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-mono); font-size: 11px; color: var(--ui-soft); background: color-mix(in srgb, var(--ui-card) 85%, transparent);
  padding: 4px 10px; border: 1px solid var(--ui-ink); border-radius: 10px; }
.lang-en .place small { display: none; }
.keys { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 32px)); flex-direction: column; align-items: stretch; gap: 10px;
  max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--ui-card); color: var(--ui-ink); border: 1.5px solid var(--ui-ink); border-radius: 14px; padding: 18px 20px; box-shadow: 0 18px 50px var(--ui-shadow); z-index: 4; }
[hidden] { display: none !important; }
.keys h2 { margin: 0; font-family: var(--font-map); font-style: italic; font-weight: 600; font-size: 24px; }
.keys dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; align-items: baseline; }
.keys dt { display: flex; gap: 4px; justify-content: flex-end; }
.keys .or { color: var(--ui-faint); font-family: var(--font-mono); font-size: 11px; align-self: center; }
.keys dd { margin: 0; color: var(--ui-soft); font-size: 14px; }
.keys kbd, .hint kbd { font-family: var(--font-mono); font-size: 11px; min-width: 22px; text-align: center; padding: 2px 6px; border: 1px solid var(--ui-ink);
  border-bottom-width: 2px; border-radius: 5px; background: var(--ui-card); color: var(--ui-ink); }
.keys p { margin: 0; font-family: var(--font-mono); font-size: 11px; color: var(--ui-faint); }
.foot { gap: 10px; }
.clock { color: var(--ui-ink); font-weight: 600; }
.clock::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--sun, var(--mustard)); vertical-align: 0; border: 1px solid var(--ui-ink); }
.crumb { top: calc(60px + env(safe-area-inset-top, 0px)); left: calc(14px + env(safe-area-inset-left, 0px));
  font-family: var(--font-mono); font-size: 12px; background: var(--ui-card); border: 1px solid var(--ui-ink); border-radius: 999px; padding: 4px 6px; }
.crumb button, .tools button { font: inherit; color: inherit; background: none; border: 0; padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.crumb button:hover, .tools button:hover { background: var(--ui-line); }
.crumb .here { padding: 2px 8px; font-weight: 600; }
.crumb .sep { color: var(--ui-faint); }
.tools { top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px));
  font-family: var(--font-mono); font-size: 12px; background: var(--ui-card); border: 1px solid var(--ui-ink); border-radius: 999px; padding: 4px; }
.tools button[aria-pressed="true"] { background: var(--ui-hot); }
.compass { left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--ui-card); border: 1px solid var(--ui-ink); border-radius: 999px; padding: 4px; color: var(--ui-ink); }
.compass svg { width: 40px; height: 40px; display: block; }

.info { right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: min(340px, calc(100vw - 28px)); max-height: calc(100% - 96px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  flex-direction: column; align-items: stretch; gap: 0;
  background: color-mix(in srgb, var(--ui-card) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--ui-ink); border-radius: 14px; box-shadow: 0 18px 50px var(--ui-shadow); }
.mobile-bubble { display: none; }
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 0 16px; }
.fold { font-family: var(--font-mono); font-size: 11px; color: var(--ui-soft); background: none; border: 1px solid var(--ui-line);
  border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.fold:hover { border-color: var(--ui-ink); }
.info .panel { padding: 8px 16px 14px; overflow-y: auto; overscroll-behavior: contain; }
.info .hint { padding: 8px 16px 10px; border-top: 1px solid var(--ui-line); font-family: var(--font-mono); font-size: 11px; color: var(--ui-faint); }
.info.folded .panel, .info.folded .hint { display: none; }
.info.folding { overflow: hidden; transition: height .38s cubic-bezier(.2, .8, .2, 1), opacity .7s, transform .8s; }
.info.folding .panel, .info.folding .hint { transition: opacity .25s; }
.info.folding.folded .panel, .info.folding.folded .hint { opacity: 0; }
.info.folded .info-head { padding-bottom: 10px; }
@media (max-width: 560px) {
  .info { left: calc(10px + env(safe-area-inset-left, 0px)); right: auto; width: min(300px, calc(100% - 80px));
    bottom: calc(50px + env(safe-area-inset-bottom, 0px)); max-height: 52%; }
  .brand { left: calc(10px + env(safe-area-inset-left, 0px)); }
  .crumb { left: auto; right: calc(10px + env(safe-area-inset-right, 0px)); top: calc(14px + env(safe-area-inset-top, 0px)); max-width: 46%; overflow-x: auto; white-space: nowrap; }
  .map-controls { display: flex; position: absolute; z-index: 3; right: calc(10px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); flex-direction: column; align-items: center; gap: 6px; }
  .map-controls .compass, .map-controls .tools { position: relative; inset: auto; }
  .map-controls .compass { width: 44px; height: 44px; justify-content: center; padding: 3px; }
  .map-controls .compass svg { width: 32px; height: 32px; }
  .map-controls .tools { flex-direction: column; gap: 2px; padding: 10px 4px; }
  .map-controls .tools .sep { width: 22px; height: 1px; margin: 2px 0; }
  .map-controls .tools button { min-width: 34px; }
  .foot { left: calc(10px + env(safe-area-inset-left, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 1024px), (max-width: 1366px) and (pointer: coarse) {
  .info { width: min(300px, calc(100% - 80px)); max-height: 52%; }
  .map:not(.in-city) .info, .info.bubble-closed { display: none; }
  .info .info-head, .info .panel, .info .hint { display: none; }
  .info .mobile-bubble { display: flex; align-items: flex-start; gap: 8px; padding: 12px; }
  .bubble-copy { min-width: 0; flex: 1; }
  .bubble-copy strong { display: block; font-size: 15px; line-height: 1.35; }
  .bubble-copy p { margin: 4px 0 0; color: var(--ui-soft); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
  .bubble-open, .bubble-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--ui-ink); border-radius: 8px; cursor: pointer; }
  .bubble-open { color: #171614; background: var(--coral); }
  .bubble-open .ext { width: 16px; height: 16px; }
  .bubble-close { color: var(--ui-ink); background: var(--ui-card); font: inherit; font-size: 20px; line-height: 1; }
  .bubble-open:hover, .bubble-close:hover { filter: brightness(1.05); }
}

@media (min-width: 561px) and (max-width: 760px) { .info { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } }

.loader { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: var(--ui-card); transition: opacity .6s .2s, visibility 0s .8s, background-color .8s; }
.loader.done { opacity: 0; visibility: hidden; }
.ld-paper { position: relative; width: 120px; height: 70px; perspective: 400px; margin-bottom: 8px; }
.ld-paper i { position: absolute; bottom: 0; width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent;
  border-bottom: 52px solid var(--slate); transform-origin: 50% 100%; animation: fold 2.2s cubic-bezier(.5, 0, .2, 1) infinite; }
.ld-paper i:nth-child(1) { left: 4px; border-bottom-color: var(--pine); border-bottom-width: 40px; }
.ld-paper i:nth-child(2) { left: 30px; border-bottom-color: var(--slate); border-bottom-width: 66px; border-left-width: 22px; border-right-width: 22px; animation-delay: .15s; }
.ld-paper i:nth-child(3) { left: 64px; border-bottom-color: var(--mustard); border-bottom-width: 46px; animation-delay: .3s; }
.ld-paper i:nth-child(4) { left: 90px; border-bottom-color: var(--olive); border-bottom-width: 34px; animation-delay: .45s; }
@keyframes fold { 0% { transform: rotateX(90deg); } 30%, 70% { transform: rotateX(0deg); } 100% { transform: rotateX(-90deg); } }
.ld-title { font-family: var(--font-map); font-style: italic; font-weight: 600; font-size: 26px; color: var(--ui-ink); }
.ld-step { font-family: var(--font-mono); font-size: 12px; color: var(--ui-faint); }
.ld-bar { width: 180px; height: 3px; background: var(--ui-line); border-radius: 2px; overflow: hidden; }
.ld-bar i { display: block; height: 100%; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
@media (prefers-reduced-motion: reduce) { .ld-paper i { animation: none; } }
.fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--ui-soft); }

/* 3D labels */
.c-tag { pointer-events: none; cursor: pointer; color: var(--ui-ink); background: var(--ui-card); border: 1px solid var(--ui-ink);
  border-radius: 8px; padding: 2px 10px 4px; white-space: nowrap; display: grid; justify-items: center; line-height: 1.15;
  transform: translateY(-50%); transition: background .15s; font: inherit; }
.c-tag .en { font-family: var(--font-map); font-style: italic; font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.c-tag .zh { font-family: var(--font-mono); font-size: 10.5px; color: var(--ui-faint); }
.c-tag:hover, .c-tag.hot { background: var(--ui-hot); }
.c-tag::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 1px; height: 8px; background: var(--ui-ink); }
.d-tag { pointer-events: none; cursor: pointer; font-family: var(--font-mono); font-size: 11.5px; color: var(--ui-ink);
  background: color-mix(in srgb, var(--ui-card) 90%, transparent); border: 1px solid var(--ui-line); border-radius: 6px;
  padding: 1px 6px; white-space: nowrap; transform: translateY(-60%); }
.d-tag { transition: opacity .35s ease, border-color .15s; }
.c-tag.fade, .d-tag.fade { opacity: 0 !important; pointer-events: none; }
.d-tag b { font-weight: 400; color: var(--ui-faint); margin-right: 5px; }
.d-tag:hover, .d-tag.hot { border-color: var(--ui-ink); }
.d-tag.sel { background: var(--coral); border-color: var(--ui-ink); color: #171614; }
.d-tag.sel b { color: #171614; }
.place { font-family: var(--font-map); font-style: italic; font-weight: 500; font-size: 17px; letter-spacing: .14em;
  color: var(--ui-soft); white-space: nowrap; text-shadow: 0 0 6px var(--ui-card), 0 0 3px var(--ui-card), 0 0 1px var(--ui-card); text-align: center; line-height: 1.1;
  transition: opacity .4s; }
.place small { display: block; font-family: var(--font-mono); font-style: normal; font-size: 10px; letter-spacing: .3em; color: var(--ui-faint); }
.place.water { color: var(--ui-water); }
.in-city .place { opacity: 0; }

/* Panel */
.panel { display: grid; gap: 12px; min-width: 0; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ui-faint); }
.panel h2 { margin: 0; font-family: var(--font-map); font-style: italic; font-weight: 600; font-size: 28px; line-height: 1.05; text-wrap: balance; }
.panel h2 small { display: block; font-family: var(--font-sans); font-style: normal; font-weight: 600; font-size: 14px; color: var(--ui-soft); margin-top: 4px; }
.panel p { margin: 0; color: var(--ui-soft); }
.list { list-style: none; margin: 0; padding: 8px 0 0; display: grid; gap: 2px; border-top: 1px solid var(--ui-line); }
.list button { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  text-align: left; font: inherit; color: inherit; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; }
.list button:hover { background: var(--ui-line); }
.list button[aria-current="true"] { background: var(--ui-hot); }
.code { font-family: var(--font-mono); font-size: 11px; color: var(--ui-faint); font-variant-numeric: tabular-nums; }
.list button { align-items: center; }
.emblem { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fffaf0;
  font-family: var(--font-map); font-style: italic; font-weight: 600; font-size: 17px; line-height: 1; border: 1px solid var(--ui-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.swatch { width: 14px; height: 14px; background: var(--c); border: 1px solid var(--ui-ink); transform: rotate(45deg); margin: 0 6px 0 4px; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .15); }
.grid-ref { font-family: var(--font-mono); font-size: 10.5px; color: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: 4px; padding: 1px 5px; letter-spacing: .05em; }
.list .nm { font-weight: 600; min-width: 0; }
.list .nm i { font-family: var(--font-map); font-weight: 600; font-size: 17px; }
.list .nm em { display: block; font-style: normal; font-weight: 400; font-size: 13px; color: var(--ui-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-family: var(--font-mono); font-size: 11px; color: var(--ui-faint); }
.list li:has(.go) { position: relative; }
.go { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; gap: 4px; align-items: center;
  visibility: hidden; text-decoration: none; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: #171614; background: var(--coral); border: 1px solid var(--ui-ink); border-radius: 8px; padding: 5px 8px; }
.list li:hover .go, .list li:focus-within .go { visibility: visible; }
.list li:hover:has(.go) .grid-ref, .list li:focus-within:has(.go) .grid-ref { visibility: hidden; }
.go:hover { filter: brightness(1.05); }
@media (hover: none) {
  .list li:has(button[aria-current="true"]) .go { visibility: visible; }
  .list li:has(button[aria-current="true"]) .grid-ref { visibility: hidden; }
}
:focus-visible { outline: 2px solid var(--coral-deep); outline-offset: 2px; }
.ui, .c-tag, .d-tag, .place, .panel, .list button { transition: background-color 1.5s, color 1.5s, border-color 1.5s; }

.foot .ver { color: var(--ui-faint); text-decoration: none; }
.foot .ver:hover { color: var(--ui-ink); text-decoration: underline; }
.go .ext { transition: transform .2s; }
.go:hover .ext { transform: translate(1px, -1px); }
.site-h1 { margin: 0; font: inherit; display: contents; }
.no-js { position: fixed; inset: 0; overflow: auto; z-index: 6; background: var(--ui-card); color: var(--ui-ink); padding: 24px max(16px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; font-family: var(--font-sans); }
.no-js h2 { font-family: var(--font-map); font-style: italic; text-transform: capitalize; margin: 0 0 8px; }
.no-js ul { margin: 0; padding-left: 18px; }
.no-js a { color: var(--ui-ink); }
/* entrance: chrome slides in from its own edge, labels and panel content follow in steps */
.brand { --d: 0ms; } .crumb { --d: 90ms; } .tools { --d: 170ms; } .compass { --d: 270ms; } .foot { --d: 330ms; } .info { --d: 400ms; }
.brand, .crumb, .tools, .compass, .foot, .info {
  transition: opacity .7s cubic-bezier(.2, .8, .2, 1) var(--d), transform .8s cubic-bezier(.2, .8, .2, 1) var(--d),
    background-color 1.5s, color 1.5s, border-color 1.5s; }
.intro .brand, .intro .crumb, .intro .tools { opacity: 0; transform: translateY(-14px); }
.intro .compass, .intro .foot { opacity: 0; transform: translateY(14px); }
.intro .info { opacity: 0; transform: translateX(28px) scale(.985); }
.c-tag, .place { transition: opacity .6s ease var(--d, 0s), background-color .15s, color 1.5s, border-color 1.5s; }
.intro .labels .c-tag, .intro .labels .place { opacity: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.revealing .panel > *, .revealing .panel .list li { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.revealing .panel > :nth-child(1) { animation-delay: .5s; }
.revealing .panel > :nth-child(2) { animation-delay: .6s; }
.revealing .panel > :nth-child(3) { animation-delay: .7s; }
.revealing .panel > .list { animation: none; }
.revealing .panel .list li:nth-child(1) { animation-delay: 0.84s; }
.revealing .panel .list li:nth-child(2) { animation-delay: 0.90s; }
.revealing .panel .list li:nth-child(3) { animation-delay: 0.96s; }
.revealing .panel .list li:nth-child(4) { animation-delay: 1.02s; }
.revealing .panel .list li:nth-child(5) { animation-delay: 1.08s; }
.revealing .panel .list li:nth-child(6) { animation-delay: 1.14s; }
.revealing .panel .list li:nth-child(7) { animation-delay: 1.20s; }
.revealing .panel .list li:nth-child(8) { animation-delay: 1.26s; }
.revealing .panel .list li:nth-child(9) { animation-delay: 1.32s; }
.revealing .panel .list li:nth-child(10) { animation-delay: 1.38s; }
.revealing .panel .list li:nth-child(11) { animation-delay: 1.44s; }
@media (prefers-reduced-motion: reduce) {
  .brand, .crumb, .tools, .compass, .foot, .info, .c-tag, .place { transition: none; }
  .revealing .panel > *, .revealing .panel .list li { animation: none; }
}

.foot .ver:empty { display: none; }

.tools { position: absolute; }
.tools:has(.lang-menu:not([hidden])), .tools:has(.city-menu:not([hidden])) { z-index: 6; }
.lang-menu, .city-menu { position: absolute; top: calc(100% + 6px); right: 0; display: grid; min-width: 140px; padding: 4px; gap: 2px;
  background: var(--ui-card); border: 1px solid var(--ui-ink); border-radius: 10px; box-shadow: 0 12px 30px var(--ui-shadow); z-index: 5; }
.lang-menu.up { top: auto; bottom: calc(100% + 6px); }
@media (max-width: 560px) { .lang-menu, .lang-menu.up { top: auto; bottom: 0; right: calc(100% + 6px); } }
.lang-menu button, .city-menu button { text-align: left; border-radius: 6px; padding: 6px 10px; font-family: var(--font-sans); font-size: 13px; }
.lang-menu button[aria-checked="true"] { background: var(--ui-hot); font-weight: 600; }
.city-menu { left: var(--city-menu-x, 0px); right: auto; width: 160px; max-height: min(60vh, 400px); overflow-y: auto; }
.city-menu button { display: block; width: 100%; }
.city-menu button[aria-current="location"] { background: var(--ui-hot); font-weight: 600; }
#b-cities { display: none; }
@media (max-width: 1024px), (max-width: 1366px) and (pointer: coarse) { #b-cities { display: inline-flex; } }
@media (max-width: 560px) { .city-menu { top: 0; bottom: auto; left: auto; right: calc(100% + 6px); } }

.tools button { display: inline-flex; align-items: center; gap: 5px; }
#b-keys { min-width: 32px; justify-content: center; }
.tools .ic { width: 15px; height: 15px; flex: none; }
@media (max-width: 760px) { .tools button .t { display: none; } .tools button:not(#b-keys) { padding: 5px 8px; } #b-lang .t { display: inline; } }
@media (max-width: 560px) { #b-lang .t, #b-keys, .tools:has(#b-lang[hidden]) .sep { display: none; } }
