/* CORE World — prototype styles. Tokens follow docs/DESIGN.md (platform panels + brand cyan). */
:root { color-scheme: dark; --void: #02050b; --panel: rgba(13, 17, 23, 0.94); --surface: #161b22; --line: #232c37; --ink: #e6edf3; --muted: #8b98a5; --accent: #6fd3ee; --cyan: #78e8ff; --amber: #ffb84d; --magenta: #ff5cd6; --gap: 12px; --navh: 46px;
  --display: 'Oxanium', 'Segoe UI', system-ui, sans-serif; --body: 'IBM Plex Sans', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace; }
* { box-sizing: border-box; } [hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--ink); font: 14px/1.45 var(--body); overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: #fff; color: #05131d; padding: 8px 10px; } .skip:focus { top: 8px; }
:focus-visible { outline: 2px solid #79c0ff; outline-offset: 2px; }
a { color: var(--cyan); }
button, select, input, textarea { font: inherit; color: var(--ink); }
button { min-height: 32px; padding: 6px 12px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
button.primary { background: var(--cyan); color: #04101f; border: 0; font: 600 14px var(--display); letter-spacing: .14em; padding: 12px 26px; border-radius: 999px; }
button.ghost { background: transparent; } button.small { min-height: 28px; padding: 3px 8px; }
button[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea { background: #0d1117; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; }
input[type=range] { min-height: 24px; padding: 0; vertical-align: middle; }
.bar { position: fixed; z-index: 20; inset: 0 0 auto 0; height: var(--navh); display: flex; align-items: center; gap: 14px; padding: 0 14px; background: rgba(2, 5, 11, .86); border-bottom: 1px solid var(--line); }
.mark { font: 700 18px var(--display); letter-spacing: .2em; color: var(--cyan); } .mark span { font-size: 15px; } .mark b { color: var(--ink); letter-spacing: .08em; font-weight: 500; margin-left: 4px; }
.proto { font: 600 11px var(--mono); color: var(--amber); border: 1px solid #5b4a1d; padding: 2px 6px; border-radius: 3px; }
.bar nav { margin-left: auto; display: flex; gap: 14px; font-size: 12.5px; }
#map { position: fixed; inset: var(--navh) 0 0 0; }
.screen { position: fixed; z-index: 15; left: 50%; top: 50%; transform: translate(-50%, -46%); width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - var(--navh) - 24px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.screen h2 { font: 600 22px var(--display); letter-spacing: .04em; margin: 0 0 8px; }
.fine { color: var(--muted); font-size: 12.5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.preset { display: grid; justify-items: center; gap: 4px; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: #0d1117; }
.preset[aria-checked="true"] { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.custom { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0 0; padding: 10px 12px; display: grid; gap: 8px; }
.custom .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; } .swatch { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.swatch[aria-checked="true"] { border-color: #fff; }
#hud .labels { position: fixed; z-index: 10; left: var(--gap); top: calc(var(--navh) + var(--gap)); display: flex; flex-direction: column; gap: 4px; max-width: min(420px, calc(100vw - 24px)); }
.tag { font: 600 11px var(--mono); padding: 3px 7px; border-radius: 3px; width: fit-content; background: rgba(2,5,11,.75); }
.tag.holo { color: var(--cyan); border: 1px solid #1f4757; } .tag.real { color: #e9dcc4; border: 1px solid #6b5d48; } .tag.fine { font: 11.5px var(--body); color: var(--muted); border: 1px solid var(--line); }
.tools { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; max-width: calc(100vw - 24px); font-size: 12.5px; }
.tools label { display: flex; align-items: center; gap: 6px; }
.help { position: fixed; z-index: 9; left: var(--gap); bottom: 64px; margin: 0; max-width: 360px; font-size: 12px; color: var(--muted); background: rgba(2,5,11,.75); padding: 6px 8px; border-radius: 5px; }
.perf { position: fixed; z-index: 9; right: var(--gap); top: calc(var(--navh) + var(--gap)); margin: 0; font: 11px var(--mono); color: var(--muted); background: rgba(2,5,11,.75); padding: 4px 6px; border-radius: 4px; }
.panel { position: fixed; z-index: 12; right: var(--gap); top: calc(var(--navh) + var(--gap)); bottom: 64px; width: min(420px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.panel > header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 0; font: 600 16px var(--display); }
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; flex-wrap: wrap; } .tabs button { border-radius: 5px 5px 0 0; font-size: 12.5px; padding: 4px 8px; } .tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
#panel-body { overflow: auto; padding: 10px 12px; display: grid; gap: 8px; align-content: start; }
#panel-body h3 { margin: 6px 0 2px; font: 600 13px var(--display); letter-spacing: .04em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; font-size: 12.5px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.badge { font: 700 10.5px var(--mono); letter-spacing: .06em; padding: 1px 6px; border-radius: 3px; border: 1px solid; }
.badge.observed { color: var(--cyan); } .badge.approx { color: var(--amber); } .badge.synthetic { color: var(--magenta); } .badge.info { color: var(--accent); } .badge.none { color: var(--muted); }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; } .stages li.no { color: var(--muted); } .stages li b { display: inline-block; min-width: 18px; }
.chat { display: grid; gap: 6px; max-height: 42vh; overflow: auto; } .msg { padding: 6px 8px; border-radius: 6px; font-size: 13px; white-space: pre-line; }
.msg.me { background: #1b2735; justify-self: end; max-width: 85%; } .msg.agent { background: #0b2230; border: 1px solid #1f4757; } .msg.sys { color: var(--amber); font-size: 12px; }
.msg small { display: block; color: var(--muted); font: 10.5px var(--mono); margin-top: 3px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; } .chips button { font-size: 12px; padding: 3px 8px; min-height: 26px; border-radius: 999px; }
.row2 { display: flex; gap: 6px; } .row2 input, .row2 textarea { flex: 1; }
textarea { width: 100%; min-height: 84px; resize: vertical; }
.contrib { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; }
.toast { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(var(--navh) + 12px); margin: 0; background: var(--panel); border: 1px solid #1f4757; color: var(--ink); padding: 6px 12px; border-radius: 6px; font-size: 13px; max-width: calc(100vw - 24px); }
.toast:empty { display: none; }
.fatal { position: fixed; z-index: 40; inset: auto 12px 80px 12px; background: #3a1414; border: 1px solid #ff7b72; padding: 10px; border-radius: 6px; }
/* Map markers */
.avatar-mk { pointer-events: none; } .avatar-mk .human-svg { display: block; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.avatar-mk.walking .leg.l { animation: legL .55s ease-in-out infinite alternate; transform-origin: 25px 52px; }
.avatar-mk.walking .leg.r { animation: legR .55s ease-in-out infinite alternate; transform-origin: 34px 52px; }
.avatar-mk.walking .arm.l { animation: legR .55s ease-in-out infinite alternate; transform-origin: 16px 31px; }
.avatar-mk.walking .arm.r { animation: legL .55s ease-in-out infinite alternate; transform-origin: 43px 31px; }
@keyframes legL { from { transform: rotate(14deg); } to { transform: rotate(-14deg); } } @keyframes legR { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.avatar-mk .nm, .agent-mk .nm { display: block; text-align: center; font: 600 11px var(--mono); color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; }
.agent-mk { cursor: pointer; background: none; border: 0; padding: 0; min-height: 0; } .agent-mk .agent-svg { display: block; filter: drop-shadow(0 0 10px rgba(120,232,255,.55)); }
.agent-mk .halo { animation: halo 2.4s ease-in-out infinite; transform-origin: 32px 24px; } @keyframes halo { 50% { transform: scale(1.18); opacity: .15; } }
.agent-mk .nm { color: var(--cyan); }
.joy { display: none; position: fixed; z-index: 11; left: 18px; bottom: 76px; width: 120px; height: 120px; border-radius: 50%; border: 1px solid #1f4757; background: rgba(2,5,11,.5); touch-action: none; }
.joy .knob { position: absolute; left: 40px; top: 40px; width: 40px; height: 40px; border-radius: 50%; background: rgba(120,232,255,.45); }
@media (pointer: coarse), (max-width: 700px) { .joy { display: block; } .help { display: none; } }
@media (max-width: 700px) {
  .bar { gap: 8px; } .mark { font-size: 15px; white-space: nowrap; } .proto { font-size: 10px; white-space: nowrap; } .bar nav a:first-child { display: none; }
  .panel { top: auto; bottom: 150px; left: 8px; right: 8px; width: auto; max-height: 55dvh; } #hud .labels .tag.fine { display: none; }
  .perf { display: none; }
  .tools { left: auto; right: 8px; transform: none; bottom: 40px; width: 170px; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; }
  .tools button { font-size: 12px; padding: 4px 6px; white-space: normal; } .tools label { display: none; }
  .joy { left: 12px; bottom: 40px; } .toast { top: auto; bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) { .avatar-mk.walking .leg, .avatar-mk.walking .arm, .agent-mk .halo { animation: none !important; } }
/* CORE shell navigation (src/shell/nav.mjs), shared by World, Dialogue and Commons */
.bar .mark { text-decoration: none; }
.core-nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; } .core-nav::-webkit-scrollbar { display: none; }
.core-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; white-space: nowrap; }
.core-nav a { display: inline-block; padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font: 500 13px var(--body); min-height: 24px; }
.core-nav a:hover { color: var(--ink); background: #ffffff0d; } .core-nav a[aria-current="page"] { color: var(--cyan); background: #78e8ff14; }
.core-nav a.primary-link { color: var(--ink); font-weight: 600; }
.journey-chip { font: 600 11.5px var(--mono); color: var(--accent); border: 1px solid #1f4757; border-radius: 999px; padding: 3px 9px; text-decoration: none; white-space: nowrap; }
@media (max-width: 700px) { .bar .proto { display: none; } .core-nav a { padding: 6px 7px; font-size: 12.5px; } }
.pb-popup { font-size: 13px; color: var(--ink); } .pb-popup ul { margin: 6px 0; padding-left: 16px; } .pb-popup li { margin: 3px 0; } .pb-popup a { color: var(--cyan); }
.maplibregl-popup-content { background: #0d1117; border: 1px solid #1f4757; border-radius: 8px; color: var(--ink); } .maplibregl-popup-close-button { color: var(--ink); font-size: 18px; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: #0d1117; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: #0d1117; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #0d1117; } .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #0d1117; }
body:has(#world-panel:not([hidden])) .perf { display: none; }
