/* ==========================================================================
   World viewer HUD: plain text laid on the world. One sans-serif, small sizes,
   a faint shadow for legibility; no boxes, borders, pills, glows or animation.
   Layout modes are classes on <html>, set by ui.js from the viewport:
     (none)      wide desktop
     .m-medium   721–1000 px wide
     .m-compact  ≤ 720 px wide or ≤ 480 px tall: a top line, popovers, the inspector is a sheet
     .m-land     with .m-compact, a short landscape screen: the sheet docks right
   ========================================================================== */

:root {
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.8);
  --dim: rgba(255, 255, 255, 0.62);
  --bad: #ffa69c;
  --accent: #ffd27a;
  --shade: 0 0 3px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 0, 0, 0.75);
  --sheet-bg: rgba(12, 14, 18, 0.82);
  --gap: 14px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sheet-h: 0px;
  --sheet-w: 0px;
  --right-bottom: 0px;
  --font: Arial, Helvetica, sans-serif;
  font: 12px/1.45 var(--font);
  color: var(--text);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: #0b0f14; overflow: hidden;
  overscroll-behavior: none; touch-action: none; -webkit-tap-highlight-color: transparent;
}
body { position: fixed; inset: 0; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }

#view { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; cursor: grab; touch-action: none; }
#view:active { cursor: grabbing; }

/* ---------- primitives ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: var(--shade); }
#hud > * { position: absolute; }
#hud section:not(.stack), #hud aside, #identity, #banner, .pop { pointer-events: auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: baseline; gap: 10px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font: inherit; }
h2 { color: var(--muted); margin: 12px 0 3px; }
code, kbd, pre, output, input, textarea, select { font: inherit; color: inherit; }
code { -webkit-user-select: text; user-select: text; }
ul, ol { list-style: none; margin: 0; padding: 0; }
.scroll { overflow: auto; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { display: none; }
.swatch { display: inline-block; width: 8px; height: 8px; flex: none; }

button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  text-shadow: inherit; touch-action: manipulation; -webkit-user-select: none; user-select: none; text-align: inherit;
}
button:hover, button:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: none; }
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- top-left: identity, toolbar, popovers ---------- */
#top-left { left: calc(var(--gap) + var(--sal)); top: calc(var(--gap) + var(--sat)); width: 330px; pointer-events: none; }
#identity { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; white-space: nowrap; }
#me-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: bold; }
#toolbar { flex: 1 0 100%; display: flex; gap: 0 12px; flex-wrap: wrap; }
.tool { color: var(--muted); }
.tool.on { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.has-lobby.no-agents #tb-players { display: none; }
.compact-only { display: none !important; }

.pop { display: none; }
.show-players #players, .show-xray #xray, .show-perf #perf { display: block; }
.show-proposals #proposals { display: flex; }

#player-list:not(:empty) { margin-bottom: 8px; }
.has-lobby #player-list { display: none; }
#player-list li, #agents-list li { display: flex; align-items: baseline; gap: 8px; min-width: 0; line-height: 1.6; }
#player-list .swatch { align-self: center; }
#player-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player-list li.me .name { font-weight: bold; }
#player-list .credits { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
#agents-list { max-height: 40vh; overflow: auto; scrollbar-width: none; }
#agents-list li { cursor: pointer; }
#agents-list li:hover .aid { text-decoration: underline; }
#agents-list li.sel .aid { font-weight: bold; }
#agents-list .aheld { margin-left: auto; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#agents-list li.away { color: var(--muted); }
#agents-list li.stuck .aid::after { content: " stuck"; color: var(--bad); }
#agents .row { margin-bottom: 2px; }

.pop { max-width: 260px; }
#xray label { cursor: pointer; display: block; }
#xray label:hover { text-decoration: underline; text-underline-offset: 2px; }
#xray input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
#xray-level {
  -webkit-appearance: none; appearance: none; background: none; width: 220px; max-width: 100%; height: 16px; margin: 4px 0 0; display: block; touch-action: none; cursor: pointer;
}
#xray-level::-webkit-slider-runnable-track { height: 1px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 2px rgba(0, 0, 0, 0.6); }
#xray-level::-moz-range-track { height: 1px; background: rgba(255, 255, 255, 0.85); }
#xray-level::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 2px rgba(0, 0, 0, 0.6); }
#xray-level::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 0; }
#xray-level:disabled { opacity: 0.4; cursor: default; }

/* ---------- proposals ---------- */
#proposals {
  flex-direction: column; width: 100%; max-width: none; max-height: calc(100vh - 2 * var(--gap) - 300px);
}
#proposals > header { flex: none; margin-bottom: 6px; }
#proposals-body { display: grid; gap: 16px; align-content: start; min-height: 0; }
.empty { color: var(--muted); line-height: 1.5; }
.empty b { color: var(--text); font-weight: normal; display: block; }
.notice { color: var(--bad); line-height: 1.45; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.notice b { font-weight: normal; }
.notice .hint { color: var(--muted); display: block; }
.prop { display: grid; gap: 6px; min-width: 0; }
.prop > header { min-width: 0; }
.prop .ptitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prop .ttl { color: var(--muted); white-space: nowrap; }
.prop .ttl.soon { color: var(--bad); }
.writes { display: grid; gap: 6px; min-width: 0; }
.write { min-width: 0; display: grid; gap: 3px; }
.wpath { display: flex; gap: 6px; min-width: 0; color: var(--muted); }
.wpath .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; unicode-bidi: plaintext; }
.facet { display: grid; grid-template-columns: 52px 1fr; gap: 2px 8px; min-width: 0; }
.facet > span { color: var(--muted); }
.facet > div { min-width: 0; overflow-wrap: anywhere; }
.old, .arrow { color: var(--muted); }
.changed { color: var(--accent); }
s { color: var(--muted); }
pre { margin: 0; }
.code { font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace; max-height: 220px; tab-size: 4; touch-action: pan-x pan-y; -webkit-user-select: text; user-select: text; }
.code span { display: block; white-space: pre; min-width: max-content; }
.code span.c { color: var(--muted); }
details.src > summary { list-style: none; cursor: pointer; color: var(--muted); }
details.src > summary::-webkit-details-marker { display: none; }
details.src > summary:hover { text-decoration: underline; }
.signline { color: var(--muted); }
.signline .need { color: var(--text); }
.cmd { display: flex; gap: 8px; min-width: 0; align-items: baseline; }
.cmd code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-user-select: all; user-select: all; }
.cmd .lead { color: var(--muted); white-space: nowrap; }
.cmd button { flex: none; color: var(--muted); }

/* ---------- top-right: lobby (join.js), performance ---------- */
#top-right { right: calc(var(--gap) + var(--sar)); top: calc(var(--gap) + var(--sat)); align-items: flex-end; pointer-events: none; }
#perf { white-space: pre; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
#perf b { color: var(--text); font-weight: normal; }

/* ---------- inspector ---------- */
#inspector {
  right: calc(var(--gap) + var(--sar)); top: max(calc(var(--gap) + var(--sat)), calc(var(--right-bottom) + var(--gap)));
  width: 280px; max-height: calc(100vh - max(calc(var(--gap) + var(--sat)), calc(var(--right-bottom) + var(--gap))) - 230px);
  display: flex; flex-direction: column;
}
.no-map #inspector { max-height: calc(100vh - max(calc(var(--gap) + var(--sat)), calc(var(--right-bottom) + var(--gap))) - 50px); }
#ins-head { flex: none; min-width: 0; }
#ins-title { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ins-owner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#ins-collapse::after { content: "–"; }
.ins-collapsed #ins-collapse::after { content: "+"; }
#ins-close, #ins-collapse { color: var(--muted); font-size: 14px; line-height: 1; padding: 0 2px; }
#ins-body { min-height: 0; padding-top: 4px; }
.ins-collapsed #ins-body { display: none; }
#ins-body .acts { margin: 2px 0 8px; gap: 12px; }
#ins-follow.active { text-decoration: underline; text-underline-offset: 2px; }
#ins-link { color: var(--muted); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#ins-words li { display: flex; gap: 8px; color: var(--muted); }
#ins-words li:last-child { color: var(--text); }
#ins-words .said { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#ins-words .when { color: var(--dim); white-space: nowrap; }
#ins-program { display: grid; gap: 8px; }
.prog { display: grid; gap: 3px; min-width: 0; }
.prog .via, .prog .stats { color: var(--muted); overflow-wrap: anywhere; }
.prog .pname { font-weight: bold; }
.prog .bad, .perr { color: var(--bad); }
.perr { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 110px; overflow: auto; -webkit-user-select: text; user-select: text; }
.logbar { margin-top: 3px; color: var(--muted); }
.logbar button { color: var(--muted); }
.logbar button.on { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.log { max-height: 132px; touch-action: pan-x pan-y; -webkit-user-select: text; user-select: text; }
.log li { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.log li.hit { color: var(--text); }
.log li.bad { color: var(--bad); }
.plain { color: var(--muted); line-height: 1.45; }
.who { color: var(--text); }
#ins-order h2 { margin-top: 4px; }
#ins-type { margin-top: 12px; }
#ins-type > summary { list-style: none; cursor: pointer; color: var(--muted); }
#ins-type > summary::-webkit-details-marker { display: none; }
#ins-type > summary:hover { text-decoration: underline; text-underline-offset: 2px; }
#ins-type[open] > summary { margin-bottom: 3px; }

/* ---------- bottom-left: ticker ---------- */
#bottom-left { left: calc(var(--gap) + var(--sal)); bottom: calc(var(--gap) + var(--sab)); width: 420px; }
#ticker li { pointer-events: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; width: fit-content; line-height: 1.6; transition: opacity 0.6s; }
#ticker li.has-pos { cursor: pointer; }
#ticker li.has-pos:hover { text-decoration: underline; text-underline-offset: 2px; }
#ticker li.old { opacity: 0.55; }
#ticker li.tone-speech { font-style: italic; }
#ticker li.tone-warn, #ticker li.tone-alert { color: var(--bad); }

/* ---------- bottom-right: minimap, coordinates, share ---------- */
#bottom-right { right: calc(var(--gap) + var(--sar)); bottom: calc(var(--gap) + var(--sab)); touch-action: none; }
#minimap-wrap { position: relative; }
#minimap { width: 300px; height: 150px; display: block; cursor: crosshair; touch-action: none; }
.no-map #minimap-wrap { display: none; }
#minimap-size { display: none; position: absolute; right: 4px; top: 2px; font-size: 14px; }
#coords-row { margin-top: 4px; gap: 12px; white-space: nowrap; }
#coords { font-variant-numeric: tabular-nums; }
#copy-link-token { color: var(--dim); }

/* ---------- HUD restore ---------- */
#hud-show { position: fixed; right: calc(var(--gap) + var(--sar)); top: calc(var(--gap) + var(--sat)); color: var(--muted); text-shadow: var(--shade); opacity: 0; transition: opacity 0.3s; z-index: 5; }
#hud-show:hover, #hud-show:focus-visible { opacity: 1; }
@media (hover: none) { #hud-show { opacity: 0.6; padding: 8px; } }
.hud-hidden #hud > :not(#toasts) { display: none !important; }

/* ---------- banner (connection), toasts, tooltip ---------- */
#banner { line-height: 1.45; -webkit-user-select: text; user-select: text; white-space: normal; }
#banner .bsub { display: block; color: var(--muted); }
#banner .elapsed { color: var(--muted); margin-left: 6px; }
#banner.auth .btext { color: var(--accent); }
#banner.auth .bsub { color: var(--muted); }
#toasts { left: 50%; bottom: calc(var(--gap) + var(--sab) + 4px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 31; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { transition: opacity 0.35s; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.toast.warn, .toast.alert { color: var(--bad); }
.toast.alert { white-space: normal; }
.toast.out { opacity: 0; }
#tooltip { pointer-events: none; white-space: nowrap; transform: translate(14px, 14px); z-index: 20; }
#tooltip .sub { color: var(--muted); }
#fatal { position: fixed; inset: 0; display: grid; place-items: center; background: #0b0f14; color: #fff; font: 13px/1.5 var(--font); padding: 24px; text-align: center; z-index: 100; -webkit-user-select: text; user-select: text; }

/* ---------- shortcuts sheet ---------- */
#shortcuts {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--sheet-bg); color: var(--text);
  padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal));
}
#shortcuts .sheet { width: min(720px, 100%); max-height: 100%; display: flex; flex-direction: column; }
#shortcuts header { margin-bottom: 12px; }
#shortcuts header .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#shortcuts-title { font-weight: bold; }
#shortcuts .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; min-height: 0; }
#shortcuts h2 { margin: 14px 0 4px; }
#shortcuts section > h2:first-child { margin-top: 0; }
dl.keys { grid-template-columns: minmax(0, auto) 1fr; gap: 2px 14px; }
dl.keys dt { color: var(--text); }
dl.keys dd { text-align: left; color: var(--muted); }
#shortcuts footer { margin-top: 14px; line-height: 1.6; }

/* ==========================================================================
   Medium: proposals drop into the left column
   ========================================================================== */
.m-medium #bottom-left { width: min(420px, calc(100vw - 2 * var(--gap) - 330px)); }

/* ==========================================================================
   Compact: phones, and anything short. A top line with toggles; panels are
   popovers under it (one at a time); the inspector is a bottom sheet.
   ========================================================================== */
.m-compact { --gap: 10px; --bar-h: 34px; --bar-extra: 0px; --bar-bottom: calc(var(--sat) + var(--gap) + var(--bar-h) + var(--bar-extra)); }
.m-compact .compact-only { display: inline-block !important; }
.m-compact .wide-only { display: none !important; }
.m-compact #top-left { right: calc(var(--gap) + var(--sar)); width: auto; gap: 6px; top: calc(var(--sat) + 4px); }
.m-compact #identity { flex-wrap: nowrap; height: var(--bar-h); align-items: center; column-gap: 4px; }
.m-compact #me-credits { display: none; }
.m-compact #toolbar { flex: none; gap: 0; margin-left: auto; flex-wrap: nowrap; }
.m-compact .tool { padding: 8px 7px; }
.m-compact #player-list li, .m-compact #agents-list li { min-height: 30px; align-items: center; }
.m-compact #agents-all { padding: 6px 0; }
.m-compact #xray { width: min(300px, 100%); }
.m-compact #xray label { padding: 6px 0; }
.m-compact #xray-level { height: 32px; width: 100%; }
.m-compact #proposals { background: var(--sheet-bg); padding: 10px 12px; text-shadow: none; }
.m-compact.show-proposals #proposals {
  width: auto; max-width: 480px;
  max-height: calc(100vh - var(--bar-bottom) - var(--gap) - max(var(--sab), var(--sheet-h)));
  max-height: calc(100dvh - var(--bar-bottom) - var(--gap) - max(var(--sab), var(--sheet-h)));
}
.m-compact.show-proposals #bottom-left, .m-compact.show-proposals #bottom-right { visibility: hidden; }
.m-compact .code { max-height: 180px; }
.m-compact #top-right { top: var(--bar-bottom); }
.m-compact #ins-follow, .m-compact #ins-goto, .m-compact #ins-link { padding: 8px 0; }
.m-compact #ins-close, .m-compact #ins-collapse { padding: 6px 8px; font-size: 18px; }
.m-compact .logbar button { padding: 6px 4px; }

/* inspector: bottom sheet, flat */
.m-compact #inspector {
  left: 0; right: 0; top: auto; bottom: 0; width: auto; margin: 0 auto; max-width: 560px;
  max-height: min(46vh, 420px); max-height: min(46dvh, 420px);
  background: var(--sheet-bg); text-shadow: none; padding: 8px 14px calc(10px + var(--sab)); z-index: 10; touch-action: none;
}
.m-compact #ins-head { cursor: pointer; touch-action: none; }
.m-compact #ins-body { touch-action: pan-y; }

/* bottom widgets ride above the sheet */
.m-compact #bottom-left, .m-compact #bottom-right { bottom: calc(var(--gap) + max(var(--sab), var(--sheet-h))); }
.m-compact #bottom-right { right: calc(var(--gap) + var(--sar) + var(--sheet-w)); }
.m-compact #minimap { width: 160px; height: 80px; cursor: pointer; }
.m-compact.map-big #minimap { width: min(calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar) - var(--sheet-w)), 420px); height: auto; aspect-ratio: 2 / 1; cursor: crosshair; }
.m-compact.map-big #minimap-size { display: block; padding: 4px 8px; }
.m-compact.map-big #bottom-left { visibility: hidden; }
.m-compact #coords-row { gap: 8px; }
.m-compact #copy-link, .m-compact #copy-link-token { padding: 6px 0; }
.m-compact #bottom-left { width: calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar) - var(--sheet-w) - 180px); }
.m-compact #ticker li:nth-last-child(n+4) { display: none; }
.m-compact #ticker li { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }

/* toasts sit under the top line on small screens */
.m-compact #toasts { bottom: auto; top: var(--bar-bottom); }
.m-compact #banner { max-width: 400px; }

.m-compact #shortcuts { padding: calc(10px + var(--sat)) calc(14px + var(--sar)) calc(10px + var(--sab)) calc(14px + var(--sal)); place-items: stretch; }
.m-compact #shortcuts .cols { grid-template-columns: 1fr; }
.m-compact #shortcuts section + section { margin-top: 14px; }
.m-compact #shortcuts header .muted { display: none; }
.m-compact #shortcuts-close { padding: 6px 0 6px 12px; }

/* short landscape: the sheet docks to the right edge, full height under the top line */
.m-land #inspector {
  left: auto; right: 0; margin: 0; width: 330px; max-width: none;
  max-height: calc(100vh - var(--bar-bottom)); max-height: calc(100dvh - var(--bar-bottom));
}
.m-land.show-proposals #proposals { max-width: min(440px, calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar) - var(--sheet-w))); max-height: calc(100vh - var(--bar-bottom) - var(--gap) - var(--sab)); max-height: calc(100dvh - var(--bar-bottom) - var(--gap) - var(--sab)); }
.m-land #shortcuts .cols { grid-template-columns: 1fr 1fr; }
.m-land #shortcuts section + section { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- in the world: player names, signs ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; text-shadow: var(--shade); }
.name-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; font: 12px/1.2 var(--font); color: #fff;
  opacity: 0; transition: transform 0.14s linear, opacity 0.25s; will-change: transform;
}
html.hud-hidden #labels { display: none; }
.sign-label { position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; font: 12px/1.2 var(--font); color: #fff; transition: opacity 0.2s; }

/* ---------- pointing: marks, selection box, focus readout, orders ---------- */
#marks-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; overflow: visible; }
#marks-layer .mk-box { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.85); stroke-width: 1; stroke-dasharray: 4 3; }
#marks-layer .mk-pin path { fill: #fff; stroke: rgba(0, 0, 0, 0.5); stroke-width: 1; }
#marks-layer .mk-pin circle { fill: rgba(0, 0, 0, 0.6); }
#marks-layer .mk-foot { fill: rgba(0, 0, 0, 0.3); }
#marks-layer text { font: 12px var(--font); fill: #fff; }
#marks-layer .mk-halo { stroke: rgba(0, 0, 0, 0.55); stroke-width: 3; stroke-linejoin: round; fill: none; }
#marks-layer [data-label] { pointer-events: auto; cursor: pointer; }
html.hud-hidden #marks-layer, html.hud-hidden #pointing { display: none; }
#band { position: fixed; border: 1px dashed rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.06); pointer-events: none; z-index: 20; }
#band-offer, #mark-edit { position: fixed; z-index: 40; display: flex; align-items: baseline; gap: 10px; text-shadow: var(--shade); color: var(--text); }
#mark-name { width: 150px; background: rgba(0, 0, 0, 0.45); border: 0; padding: 2px 5px; outline: none; color: #fff; -webkit-user-select: text; user-select: text; }
#mark-del { color: var(--muted); }

#pointing { left: 50%; top: calc(var(--gap) + var(--sat)); transform: translateX(-50%); max-width: min(560px, calc(100vw - 2 * var(--gap) - 560px)); min-width: 260px; z-index: 12; }
#pointing > .row { gap: 14px; flex-wrap: nowrap; justify-content: center; }
#pointing > .row button { white-space: nowrap; min-width: 0; }
#pointing > .row button.on { text-decoration: underline; text-underline-offset: 2px; }
#pt-sees { overflow: hidden; text-overflow: ellipsis; }
#pt-orders.bad, #pt-orders.bad .muted { color: var(--bad); }
#pt-body { margin-top: 8px; max-height: min(52vh, 420px); overflow: auto; scrollbar-width: none; text-align: left; }
#pt-body h2 { margin-top: 0; }
#pt-body .hint { color: var(--muted); margin-top: 8px; }
#pt-body kbd { color: var(--text); }
.plist li { display: flex; gap: 10px; align-items: baseline; cursor: pointer; line-height: 1.6; }
.plist li:hover .pname { text-decoration: underline; }
.plist button { color: var(--muted); }
.pdl dt { white-space: nowrap; } .pdl dd { text-align: left; }
.order { margin: 0 0 8px; cursor: pointer; }
.order:hover b { text-decoration: underline; }
.order .ostatus { color: var(--muted); }
.order.bad .ostatus, .oblock { color: var(--bad); }
.order.done { opacity: 0.6; }
.osub, .ostep { color: var(--muted); }
.ostep.now { color: var(--text); }
.m-medium #pointing { max-width: calc(100vw - 2 * var(--gap) - 300px); }
.m-compact #pointing { left: calc(var(--gap) + var(--sal)); transform: none; top: var(--bar-bottom); min-width: 0; max-width: calc(100vw - 2 * var(--gap) - 130px); }
.m-compact #pointing > .row { justify-content: flex-start; gap: 0; }
.m-compact #pointing > .row button { padding: 4px 12px 4px 0; }
.m-compact #pt-sees-text { display: none; }
.m-compact #pt-body { background: var(--sheet-bg); padding: 10px 12px; text-shadow: none; }
.m-compact.show-players #pointing, .m-compact.show-proposals #pointing, .m-compact.show-xray #pointing, .m-compact.show-perf #pointing { display: none; }
