:root {

  --night: #0a0f22; --panel: rgba(13, 19, 42, .9); --panel-2: rgba(239, 232, 216, .05); --ink: #efe8d8; --muted: #a4abc4;
  --line: rgba(239, 232, 216, .14); --copper: #e58f55; --gold: #f3c15f; --verd: #57c9ae; --lapis: #7ea4ee; --bad: #e6696e;
  --display: 'Marcellus', 'Palatino Linotype', Georgia, serif; --body: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif; --mono: 'JetBrains Mono', Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--night); color: var(--ink); font: 14px/1.5 var(--body); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#world:active { cursor: grabbing; }
.no3d #world { background: linear-gradient(#0b1026, #6a3f7c 70%, #f09a6e); }
#labels { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.lab { position: absolute; left: 0; top: 0; border: 0; background: none; pointer-events: auto; white-space: nowrap; will-change: transform; touch-action: none; }
.lab.place { font: 11.5px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 8px #000, 0 0 2px #000; opacity: .88; padding: 2px 6px; }
.lab.place:hover { color: var(--gold); opacity: 1; }
.lab.place i { display: block; font: italic 10.5px var(--body); letter-spacing: 0; text-transform: none; color: var(--gold); }
.lab.place.outside { color: var(--lapis); }
.lab.place.district { font-size: 13.5px; color: var(--gold); opacity: 1; }
.lab.place.district i { color: var(--ink); }
.lab.und { font: italic 10.5px var(--body); color: var(--muted); background: rgba(10, 15, 34, .6); border-radius: 8px; padding: 1px 7px; }
.lab.agent { z-index: 2; display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 6px; background: rgba(10, 15, 34, .78); border: 1px solid var(--line); border-radius: 10px; padding: 3px 9px 3px 7px; font-weight: 600; font-size: 12px; }
.lab.agent:hover { border-color: var(--gold); }
.lab.agent b { width: 9px; height: 9px; border-radius: 50%; }
.lab.agent i { grid-column: 1 / 3; font: italic 400 10.5px/1.25 var(--body); color: var(--muted); max-width: 170px; white-space: normal; text-align: center; }
.lab.agent i:empty { display: none; }
.lab.agent.stopped { border-color: var(--bad); }

.top { position: fixed; z-index: 5; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.top > * { pointer-events: auto; }
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand span { font: 22px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; }
.clock { padding: 9px 12px; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.meters { display: flex; gap: 14px; padding: 7px 14px; flex-wrap: wrap; }
.meter { font-size: 11.5px; color: var(--muted); min-width: 92px; }
.meter strong { display: block; color: var(--ink); font: 500 12px var(--mono); font-variant-numeric: tabular-nums; }
.meter .bar { margin-top: 3px; height: 3px; }
.spacer { flex: 1; }
.tag { font-size: 11px; color: var(--muted); padding: 6px 10px; border: 1px dashed var(--line); border-radius: 20px; background: rgba(10, 15, 34, .6); }
kbd { font: 600 11px var(--mono); background: rgba(239, 232, 216, .14); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; margin-right: 2px; }
.modes { display: flex; gap: 2px; padding: 4px; }
.modes button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; font-weight: 600; font-size: 12.5px; }
.modes button:hover { background: var(--panel-2); }
#mode { background: var(--copper); color: #1a1208; }
#mode:hover { background: var(--gold); }
.cue { position: fixed; z-index: 4; left: 100px; top: 76px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; pointer-events: none; }
.cue > * { pointer-events: auto; padding: 7px 12px; font-size: 12.5px; color: var(--muted); }
.cue [hidden] { display: none; }
#prompt { color: var(--ink); font-weight: 700; font-size: 14px; border-color: var(--gold); }
#stick { display: none; position: fixed; z-index: 5; left: 18px; bottom: 96px; width: 104px; height: 104px; border-radius: 50%; background: rgba(13, 19, 42, .6); border: 1px solid var(--line); touch-action: none; }
#stick i { position: absolute; left: 32px; top: 32px; width: 40px; height: 40px; border-radius: 50%; background: var(--copper); }
@media (pointer: coarse) { body.walking #stick { display: block; } body.walking .feed { display: none; } #hint { display: none; } }
.lab.agent.you { border-color: var(--gold); }
.kitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.kitgrid button { text-align: left; border: 1px solid var(--line); background: var(--panel-2); border-radius: 9px; padding: 7px 10px; display: grid; gap: 1px; }
.kitgrid button:hover { border-color: var(--copper); }
.kitgrid button.on { border-color: var(--gold); background: rgba(243, 193, 95, .12); }
.kitgrid small { color: var(--muted); font-size: 11.5px; }
.pv { width: 100%; height: 220px; display: block; border: 1px solid var(--line); border-radius: 10px; background: radial-gradient(circle at 50% 70%, rgba(229, 143, 85, .2), rgba(0, 0, 0, .25)); }
pre { margin: 0; font: 11.5px/1.5 var(--mono); color: var(--muted); background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
#lock { padding: 8px 14px; border: 1px solid var(--bad); background: rgba(58, 16, 22, .9); border-radius: 10px; font-weight: 600; color: #ffd9da; }
#lock[aria-pressed="true"] { background: var(--bad); color: #24090a; }
#alarm { position: fixed; z-index: 7; top: 70px; left: 50%; transform: translateX(-50%); background: var(--bad); color: #24090a; font-weight: 600; padding: 8px 16px; border-radius: 10px; max-width: calc(100% - 32px); text-align: center; }

.rail { position: fixed; z-index: 5; left: 12px; top: 74px; display: flex; flex-direction: column; gap: 2px; padding: 6px; max-height: calc(100% - 86px); overflow: auto; }
.rail a { display: grid; justify-items: center; gap: 1px; width: 62px; padding: 7px 2px 5px; border-radius: 9px; text-decoration: none; font-size: 10.5px; color: var(--muted); position: relative; }
.rail a svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail a:hover { color: var(--ink); background: var(--panel-2); }
.rail a.on { color: #1a1208; background: var(--copper); }
.rail a em { position: absolute; top: 3px; right: 8px; background: var(--gold); color: #1a1208; font: 700 10px var(--body); border-radius: 9px; padding: 0 5px; }
.rail hr { width: 70%; border: 0; border-top: 1px solid var(--line); margin: 4px auto; }

.feed { position: fixed; z-index: 4; left: 100px; bottom: 12px; width: 360px; max-width: calc(100% - 112px); padding: 10px 14px; }
.feed h2, .sheet h2 { font: 600 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--copper); margin: 0 0 6px; }
.feed ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.feed li { font-size: 12.5px; line-height: 1.35; color: var(--muted); display: grid; grid-template-columns: 9px 1fr; gap: 8px; }
.feed li b { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; }
.feed li strong { color: var(--ink); }
.feed li:nth-child(n+4) { opacity: .55; }
.enkichip { position: fixed; z-index: 4; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; padding: 10px 14px; text-align: left; max-width: 300px; }
.enkichip:hover { border-color: var(--verd); }
.enkichip small { display: block; color: var(--muted); }
body.sheet-open .enkichip { display: none; }

.sheet { position: fixed; z-index: 6; top: 74px; right: 12px; bottom: 12px; width: min(840px, calc(100% - 112px)); overflow: auto; padding: 20px 22px 26px; }
.sheet[hidden] { display: none; }
.sheet .close { position: sticky; top: 0; float: right; margin: -6px -8px 0 8px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--night); font-size: 18px; line-height: 1; z-index: 2; }
.sheet h1 { font: 28px/1.15 var(--display); margin: 0; text-wrap: balance; }
.sheet h2 { margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.sheet h2 .count { background: var(--gold); color: #1a1208; border-radius: 9px; padding: 0 6px; letter-spacing: 0; }
.sheet p { margin: 0 0 8px; max-width: 68ch; }
.lede { color: var(--muted); margin-top: 4px !important; }
.hint { color: var(--muted); font-size: 12.5px; }
.sh { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-right: 40px; }
.sh > div:nth-child(2) { flex: 1; min-width: 200px; }
.sigil { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font: 26px var(--display); color: #14101c; flex: none; }
.sigil.s { width: 34px; height: 34px; border-radius: 9px; font-size: 17px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.card h3 { font: 600 14.5px/1.3 var(--body); margin: 0; }
.card p { margin: 0; font-size: 13px; color: var(--muted); }
a.card { text-decoration: none; }
a.card:hover { border-color: var(--copper); }
.stack { display: grid; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { font: 600 10.5px var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.good { color: var(--verd); border-color: rgba(87, 201, 174, .5); }
.pill.warn { color: var(--gold); border-color: rgba(243, 193, 95, .5); }
.pill.bad { color: var(--bad); border-color: rgba(230, 105, 110, .5); }
.pill.blue { color: var(--lapis); border-color: rgba(126, 164, 238, .5); }
.id { font: 11.5px var(--mono); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 1px 8px 1px 6px; border: 1px solid var(--line); border-radius: 20px; white-space: nowrap; }
.chip b { width: 8px; height: 8px; border-radius: 50%; }
.chip:hover { border-color: var(--gold); }
.btn { border: 0; background: var(--copper); color: #1a1208; font-weight: 700; padding: 7px 13px; border-radius: 8px; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--gold); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost:hover { border-color: var(--gold); background: transparent; }
.btn.verd { background: var(--verd); }
.bar { height: 6px; border-radius: 4px; background: rgba(239, 232, 216, .1); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--copper); transition: width .5s; }
.drive { display: grid; grid-template-columns: 78px 1fr 30px; gap: 8px; align-items: center; font-size: 12.5px; }
.drive span:last-child { font: 11.5px var(--mono); text-align: right; color: var(--muted); }
.taste { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 44px; gap: 8px; align-items: center; font-size: 12.5px; }
.taste .tb { height: 6px; background: rgba(239, 232, 216, .1); border-radius: 4px; position: relative; }
.taste .tb::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.taste .tb i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.taste span:last-child { font: 11.5px var(--mono); text-align: right; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin: 14px 0 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 7px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--copper); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th { text-align: left; font: 600 10.5px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line); }
td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.steps { display: flex; gap: 4px; flex-wrap: wrap; }
.steps span { font-size: 11px; padding: 3px 9px; border-radius: 6px; background: rgba(239, 232, 216, .07); color: var(--muted); }
.steps span.done { background: rgba(87, 201, 174, .18); color: var(--verd); }
.steps span.now { background: var(--copper); color: #1a1208; font-weight: 700; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; counter-reset: f; }
.flow div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); counter-increment: f; }
.flow div::before { content: counter(f); font: 12px var(--mono); color: var(--copper); display: block; }
.flow strong { display: block; color: var(--ink); font-size: 13.5px; }
.layers { display: grid; gap: 6px; }
.layers div { border-left: 3px solid var(--copper); padding: 6px 12px; background: var(--panel-2); border-radius: 0 8px 8px 0; font-size: 13px; color: var(--muted); }
.layers div:nth-child(1) { border-color: var(--gold); } .layers div:nth-child(3) { border-color: var(--lapis); }
.layers strong { color: var(--ink); }
.split { height: 22px; border-radius: 6px; overflow: hidden; display: flex; font: 600 11px var(--body); }
.split span { display: grid; place-items: center; color: #14101c; white-space: nowrap; overflow: hidden; }
blockquote { margin: 0; padding: 8px 12px; border-left: 2px solid var(--line); font: italic 13.5px/1.5 var(--body); color: var(--muted); }
form.stack label { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
input[type=text], input[type=password], textarea, select { background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; }
textarea { resize: vertical; min-height: 64px; }
.chatbox { border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-rows: auto 1fr auto; min-height: 260px; background: rgba(0, 0, 0, .18); }
.chatbox header { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; font-weight: 600; }
.chatbox header small { font-weight: 400; color: var(--muted); margin-left: auto; }
.msgs { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.msg { max-width: 82%; padding: 6px 10px; border-radius: 12px 12px 12px 3px; background: rgba(239, 232, 216, .09); font-size: 13.5px; align-self: flex-start; }
.msg.me { align-self: flex-end; background: #2b5f55; border-radius: 12px 12px 3px 12px; }
.msg.sys { align-self: center; background: none; color: var(--muted); font-size: 11.5px; }
.chatbox form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.convs { display: grid; gap: 2px; }
.convs button { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 9px; }
.convs button.on, .convs button:hover { background: var(--panel-2); }
.convs small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #14101c; font-weight: 600; padding: 9px 16px; border-radius: 10px; max-width: calc(100% - 32px); }
.done { color: var(--verd); font-size: 13px; }
.sealed { border: 1px dashed rgba(126, 164, 238, .5); background: rgba(126, 164, 238, .07); }

#gate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(10, 15, 34, .35), rgba(10, 15, 34, .82)); padding: 16px; }
#gate[hidden] { display: none; }
#gate .door { width: min(400px, 100%); padding: 28px 28px 22px; text-align: center; display: grid; gap: 12px; }
#gate h1 { font: 44px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; margin: 6px 0 0; }
#gate p { margin: 0; color: var(--muted); }
#gate .ok { font: 12px var(--mono); color: var(--verd); }

@media (max-width: 760px) {
  .meters, .tag, .clock { display: none; }
  .rail { top: auto; bottom: 8px; left: 8px; right: 8px; flex-direction: row; max-height: none; }
  .rail a { flex: none; width: 58px; } .rail hr { display: none; }
  .feed { left: 8px; right: 8px; bottom: 78px; width: auto; max-width: none; }
  .feed li:nth-child(n+3) { display: none; }
  .enkichip { right: 8px; bottom: auto; top: 108px; padding: 7px 11px; }
  body.walking .enkichip { display: none; }
  .cue { left: 8px; top: 108px; }
  .sheet { left: 8px; right: 8px; top: 108px; bottom: 78px; width: auto; padding: 16px 14px 20px; }
  body.sheet-open .feed { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }


.quality { display: flex; gap: 2px; padding: 4px; }
.quality button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 12px; color: var(--muted); }
.quality button:hover { color: var(--ink); background: var(--panel-2); }
.quality button[aria-pressed="true"] { color: var(--ink); background: rgba(239, 232, 216, .14); }
#stats { position: fixed; z-index: 4; right: 12px; top: 74px; padding: 5px 10px; font: 11.5px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
#stats[hidden] { display: none; }
body.sheet-open #stats { display: none; }

#loading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; transition: opacity .4s ease;
  background: radial-gradient(ellipse 70% 38% at 50% 100%, rgba(255, 176, 108, .55), rgba(233, 128, 90, .22) 45%, transparent 75%),
    radial-gradient(ellipse 40% 22% at 50% 92%, rgba(255, 214, 150, .35), transparent 70%),
    linear-gradient(180deg, #0d1330 0%, #1d2552 32%, #44356b 58%, #8a4f6e 78%, #d9826a 93%, #f2a46c 100%); }
#loading::before { content: ''; position: absolute; inset: 0 0 45% 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(1px 1px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 27% 8%, #fff, transparent), radial-gradient(1px 1px at 44% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 61% 12%, #fff, transparent), radial-gradient(1px 1px at 78% 26%, #fff, transparent), radial-gradient(1px 1px at 89% 9%, #fff, transparent), radial-gradient(1px 1px at 6% 34%, #fff, transparent), radial-gradient(1px 1px at 70% 38%, #fff, transparent); }
#loading.gone { opacity: 0; pointer-events: none; }
#loading[hidden] { display: none; }
#loading .load { position: relative; width: min(620px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; }
#loading .mark { width: 92px; height: 92px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45)); }
#loading h1 { font: 46px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; margin: 2px 0 6px; color: #f6ead2; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
#loading .nine { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#loading .nine li { width: 60px; height: 60px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); overflow: hidden;
  opacity: .32; filter: grayscale(.85) brightness(.8); transform: translateY(6px) scale(.92); transition: opacity .45s, filter .45s, transform .45s, box-shadow .45s; }
#loading .nine li img { display: block; width: 100%; height: 100%; object-fit: cover; }
#loading .nine li.on { opacity: 1; filter: none; transform: none; box-shadow: 0 0 0 2px var(--c), 0 0 18px var(--c); animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.27s); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
#loading .line { width: min(420px, 90%); height: 2px; border-radius: 2px; background: rgba(246, 234, 210, .18); overflow: hidden; }
#loading .line i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%; will-change: transform; background: linear-gradient(90deg, #e9805a, #f3c15f); box-shadow: 0 0 8px #f3c15f; transition: transform .3s ease; }
#loading p { margin: 0; color: rgba(246, 234, 210, .78); font-size: 13px; }
#loading #load-n { font: 11.5px var(--mono); color: rgba(246, 234, 210, .55); font-variant-numeric: tabular-nums; }
#loading #load-err { color: #ffb4b6; font: 12px var(--mono); }
@media (prefers-reduced-motion: reduce) { #loading .nine li.on { animation: none; } #loading .nine li, #loading .line i { transition: none; } }
@media (max-width: 760px) { #loading .nine { gap: 6px; } #loading .nine li { width: 34px; height: 34px; } #loading h1 { font-size: 34px; } }
@media (max-width: 760px) { .quality { display: none; } }

.itemrow { grid-template-columns: 76px 1fr; align-items: start; gap: 12px; }
.itemrow a { text-decoration: none; }
.itemrow h3:hover { color: var(--gold); }
.thumb { width: 76px; height: 57px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.thumb.tab { background: linear-gradient(160deg, #c99a6e, #9c6f4c); box-shadow: inset 0 0 0 3px rgba(60, 35, 20, .25); position: relative; }
.thumb.tab::after { content: ''; position: absolute; inset: 12px 12px; background: repeating-linear-gradient(transparent 0 5px, rgba(60, 35, 20, .45) 5px 6.5px); }
.tabletcard { border-left: 3px solid #b8885e; }
.paintthumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 4px solid #4a3426; box-shadow: 0 0 0 1px #8a6548; }
.clay { position: relative; margin-top: 16px; padding: 26px 30px 34px; border-radius: 14px 18px 12px 16px; color: #2b1a10; max-width: 64ch;
  background: radial-gradient(circle at 20% 15%, rgba(255, 240, 210, .35), transparent 45%), radial-gradient(circle at 85% 90%, rgba(80, 45, 25, .25), transparent 50%), linear-gradient(165deg, #d7ab7d, #b98a5f 60%, #a8794f);
  box-shadow: inset 0 2px 0 rgba(255, 240, 210, .4), inset 0 -4px 10px rgba(70, 40, 20, .35), 0 10px 26px rgba(0, 0, 0, .35); }
.clay p { font: 17px/1.6 var(--display); letter-spacing: .02em; margin: 0 0 12px !important; text-shadow: 0 1px 0 rgba(255, 235, 200, .45); }
.clay .seal { position: absolute; right: 18px; bottom: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 15px var(--display); color: #1a1208; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18); }
figure.painting { margin: 16px 0 4px; padding: 14px; background: linear-gradient(135deg, #5a3e2c, #3a271b); border-radius: 6px; box-shadow: inset 0 0 0 2px #8a6548, 0 10px 26px rgba(0, 0, 0, .4); max-width: 720px; }
figure.painting img { display: block; width: 100%; height: auto; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.eyeview { min-height: 120px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .25); display: grid; place-items: center; overflow: hidden; }
.eyeview p { padding: 18px; text-align: center; }
.eyeview img { display: block; width: 100%; height: auto; }
.btn[disabled] { opacity: .5; cursor: default; }
h3.sub { margin: 0 0 6px; font: 600 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.postcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.postcard { margin: 0; background: #efe8d8; padding: 5px 5px 3px; border-radius: 3px; transform: rotate(-1deg); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.postcard:nth-child(2n) { transform: rotate(1.2deg); }
.postcard img { display: block; width: 100%; height: auto; }
.postcard figcaption { font: 10.5px var(--mono); color: #4a3f36; padding-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.postcards > p { grid-column: 1 / -1; }
.sound-switch { border: 1px solid var(--line); padding: 7px 11px; font-weight: 600; font-size: 12px; color: var(--muted); }
.sound-switch:hover { color: var(--ink); }
.sound-switch[aria-pressed="true"] { color: var(--ink); border-color: var(--verd); }
.sound-switch[hidden] { display: none; }
@media (max-width: 760px) { .sound-switch { display: none; } }

.pdot { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--ring, var(--line)); background: var(--ring, #333); }
.chip .pdot { width: 17px; height: 17px; margin: 2px 1px 2px -3px; }
.feed li { grid-template-columns: 18px 1fr; }
.feed li .pdot { margin-top: 1px; }
.feed li b { margin-left: 4px; }
img.sigil.face { object-fit: cover; box-shadow: 0 0 0 3px var(--ring); background: var(--ring); }
img.sigil.face.s { box-shadow: 0 0 0 2px var(--ring); }
.sigil.big { width: 104px; height: 104px; border-radius: 22px; font-size: 48px; }
img.sigil.face.big { box-shadow: 0 0 0 4px var(--ring), 0 10px 26px rgba(0, 0, 0, .4); }
.me { display: grid; place-items: center; padding: 6px; border-radius: 50%; }
.me .pdot { width: 30px; height: 30px; box-shadow: 0 0 0 2px var(--ring); }

body.teaser .top, body.teaser .rail, body.teaser .feed, body.teaser .enkichip, body.teaser .cue, body.teaser #labels, body.teaser #stats,
body.teaser #sheet, body.teaser #gate, body.teaser #alarm, body.teaser .toast, body.teaser #stick { display: none !important; }
body.teaser #world { cursor: default; }

.voices { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; }
.voices[hidden] { display: none; }
.voices-switch { border: 0; background: none; padding: 5px 9px; border-radius: 8px; font-weight: 600; font-size: 12px; color: var(--muted); }
.voices-switch:hover { color: var(--ink); background: var(--panel-2); }
.voices-switch[aria-pressed="true"] { color: var(--ink); background: rgba(87, 201, 174, .18); }
.mix-btn { border: 0; background: none; padding: 5px 9px; border-radius: 8px; font-weight: 600; font-size: 12px; color: var(--muted); cursor: pointer; }
.mix-btn:hover, .mix-btn[aria-expanded="true"] { color: var(--ink); background: var(--panel-2); }

#mixpanel { position: fixed; z-index: 7; right: 12px; top: 62px; width: 260px; padding: 10px 12px; display: grid; gap: 8px; font-size: 12.5px; }
#mixpanel[hidden] { display: none; }
#mixpanel label { display: grid; grid-template-columns: 70px 1fr 40px; gap: 8px; align-items: center; color: var(--muted); }
#mixpanel input[type=range] { width: 100%; accent-color: var(--verd); }
#mixpanel output { text-align: right; font: 12px var(--mono); color: var(--ink); }
#mixpanel .hint { margin: 0; font-size: 11.5px; }
.voice-vol:disabled { opacity: .4; }
.voice-vol:disabled { opacity: .4; }
@media (max-width: 760px) { .voices { display: none; } }

@media (max-width: 1780px) { .top .tag { display: none; } }
@media (max-width: 1540px) { .meters .meter:nth-child(n+3) { display: none; } }
@media (max-width: 1340px) { .top .meters { display: none; } }


.mapwrap { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #1b3a5c; }
.citymap { display: block; width: 100%; height: auto; max-height: 70vh; }
.citymap .sea { fill: #1f4a6e; }
.citymap .hx polygon, .citymap .hx circle { stroke: rgba(20, 14, 8, .55); stroke-width: 2.5; }
.citymap .hx[data-act] { cursor: pointer; }
.citymap .hx[data-act]:hover polygon, .citymap .hx[data-act]:hover circle { stroke: var(--gold); stroke-width: 4; }
.citymap .hx.open polygon { fill: none; stroke: rgba(159, 180, 255, .6); stroke-dasharray: 8 7; }
.citymap .hx.wild polygon { opacity: .92; }
.citymap text { font: 600 11px var(--body); fill: #1a1208; text-anchor: middle; pointer-events: none; }
.citymap .hx.wild text, .citymap .hx.open text { fill: #f6ead2; }
.citymap .gate rect { fill: #f3c15f; stroke: #1a1208; stroke-width: 2; }
.citymap .gate rect.main { fill: #d05d64; } .citymap .gate rect.jd { fill: #57c9ae; }
.citymap .glbl { font-size: 10px; fill: #f6ead2; paint-order: stroke; stroke: rgba(0, 0, 0, .6); stroke-width: 3px; }
.mapkeys { margin-top: 8px; gap: 12px; }
.mapkeys .key { font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.mapkeys .key b { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.mapkeys .key b.gk { background: #f3c15f; border: 1px solid #1a1208; }


.postcard.plain { transform: rotate(.6deg) scale(.9); opacity: .9; }


.citymap .river { stroke: #3f86b8; stroke-linecap: round; opacity: .95; }
.citymap .cross line { stroke-width: 4; stroke-linecap: round; }
.citymap .cross.bridge line { stroke: #8a5a34; }
.citymap .cross.ford line { stroke: #e6d2a2; stroke-dasharray: 3 3; }


.lab.und i.unnamed { display: block; font: italic 9.5px var(--body); opacity: .8; }
#clock .sky { margin-right: 6px; } #clock .sky.day { color: var(--gold); } #clock .sky.dusk, #clock .sky.dawn { color: var(--copper); } #clock .sky.night { color: var(--lapis); }

#debug { position: fixed; z-index: 5; right: 12px; top: 120px; padding: 10px 12px; display: grid; gap: 8px; font-size: 12px; width: 310px; }
#debug select, #debug input[type=text] { width: auto; flex: 1; font-size: 12px; padding: 4px 6px; } #debug .hint { margin: 0; }
#dbg-named[hidden] { display: none; } #dbg-named .btn { flex: 1; padding: 3px 6px; font-size: 12px; }
#debug[hidden] { display: none; } #debug label { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
#followchip { position: fixed; z-index: 6; left: 50%; top: 74px; transform: translateX(-50%); padding: 5px 6px 5px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
#followchip .fc-x, #followchip .fc-page { border: 1px solid var(--line); background: var(--night); color: var(--ink); border-radius: 9px; padding: 5px 12px; font: inherit; font-weight: 700; min-height: 32px; cursor: pointer; white-space: nowrap; } #followchip.lost { padding: 7px 12px; }
#followchip[hidden] { display: none; } #followchip b { width: 9px; height: 9px; border-radius: 50%; }
.photo-btn { display: grid; place-items: center; width: 38px; height: 34px; padding: 0; color: var(--ink); }
.photo-btn svg { width: 20px; height: 20px; } .photo-btn[hidden] { display: none; }
body.photo #mixpanel, body.teaser #mixpanel, body.photo .top, body.photo .rail, body.photo .feed, body.photo .enkichip, body.photo .cue, body.photo #labels, body.photo #stats, body.photo #sheet, body.photo #followchip { display: none !important; }
#photomask { position: fixed; inset: 0; z-index: 7; pointer-events: none; }
#photomask[hidden] { display: none; }
#photomask i { position: absolute; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .55); outline: 1px solid rgba(255, 255, 255, .6); }
#photopanel { position: fixed; z-index: 9; right: 16px; bottom: 16px; padding: 12px 14px; display: grid; gap: 10px; width: 250px; font-size: 13px; }
#photopanel[hidden] { display: none; } #photopanel label { display: grid; gap: 4px; color: var(--muted); } #photopanel label.row { display: flex; }
#photopanel .seg { display: flex; gap: 4px; } #photopanel .seg button { flex: 1; border: 1px solid var(--line); background: none; border-radius: 8px; padding: 5px; font-weight: 600; }
#photopanel .seg button[aria-pressed="true"] { background: var(--copper); color: #1a1208; border-color: var(--copper); }


#flying { position: fixed; z-index: 6; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 5px 12px; font: 600 12px var(--body); color: var(--gold); letter-spacing: .06em; }
#flying[hidden], .cue #hint-fly[hidden] { display: none; }
body.photo #flying { display: none !important; }







.vdock { position: fixed; z-index: 5; right: 12px; bottom: 84px; display: flex; flex-direction: column; gap: 8px; }
.vbtn { display: grid; place-items: center; align-content: center; gap: 1px; width: 60px; height: 58px; padding: 4px 2px; border-radius: 16px; font: 600 11px/1.15 var(--body); color: var(--ink); text-align: center; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.vbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vbtn:hover { border-color: var(--gold); }
.vbtn[aria-pressed="true"], .vbtn.on { background: var(--copper); color: #1a1208; border-color: var(--copper); }
#vseats[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.vlist { position: fixed; z-index: 6; right: 84px; bottom: 84px; width: 380px; max-width: calc(100% - 96px); max-height: calc(100% - 180px); overflow: auto; padding: 10px 12px 12px; }
.vlist[hidden] { display: none; }
.vlist header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.vlist header strong { font: 600 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--copper); }
.vclose { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--night); font-size: 18px; line-height: 1; }
.vgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.vseat { display: grid; justify-items: center; gap: 4px; padding: 8px 2px 6px; border: 1px solid transparent; border-radius: 12px; background: var(--panel-2); font: 600 12px/1.2 var(--body); min-height: 44px; }
.vseat:hover, .vseat[aria-current="true"] { border-color: var(--gold); }
.vseat:disabled { opacity: .4; cursor: default; }
.vseat span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vface { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 3px solid var(--ring, #888); background: var(--ring, #888); display: grid; place-items: center; font: 700 18px var(--display); color: #fff; }
.vchip { position: fixed; z-index: 6; left: 50%; top: 74px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; font-size: 12.5px; color: var(--muted); max-width: calc(100% - 24px); }
.vchip[hidden] { display: none; }
.vchip svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; }
.vchip-t { color: var(--gold); font-weight: 700; white-space: nowrap; }
.vchip .vtouch { display: none; }
.vchip-x { border: 1px solid var(--line); background: var(--night); border-radius: 9px; padding: 5px 12px; font-weight: 700; min-height: 32px; }
.vpad { display: none; }
.vpad[hidden] { display: none !important; }
.vstick { position: fixed; z-index: 5; left: 14px; bottom: 88px; width: 128px; height: 128px; border-radius: 50%; background: rgba(13, 19, 42, .55); border: 1px solid var(--line); touch-action: none; }
.vstick i { position: absolute; left: 39px; top: 39px; width: 50px; height: 50px; border-radius: 50%; background: var(--copper); box-shadow: 0 2px 10px rgba(0, 0, 0, .4); pointer-events: none; }
.vstick.on { border-color: var(--gold); }
.vpad .vbtn { position: fixed; z-index: 5; right: 12px; }
.vpad .vup { bottom: 284px; } .vpad .vdn { bottom: 218px; }
.vpad .vfast { left: 14px; right: auto; bottom: 226px; width: 60px; height: 40px; border-radius: 20px; }
body.freefly #stick, body.freefly #hint, body.freefly #hint-fly, body.freefly #flying, body.freefly #followchip, body.vfollow #stick { display: none !important; }
@media (pointer: coarse) { #hint-fly { display: none !important; } }
body.photo .vdock, body.photo .vlist, body.photo .vchip, body.photo .vpad, body.teaser .vdock, body.teaser .vlist, body.teaser .vchip, body.teaser .vpad { display: none !important; }
@media (pointer: coarse) {
  body.freefly .vpad { display: block; }
  body.freefly .feed, body.freefly .enkichip { display: none; }
  .vchip .vkeys { display: none; } .vchip .vtouch { display: inline; }
}

:root { --sa-t: env(safe-area-inset-top, 0px); --sa-b: env(safe-area-inset-bottom, 0px); --sa-l: env(safe-area-inset-left, 0px); --sa-r: env(safe-area-inset-right, 0px); }
.top { top: calc(12px + var(--sa-t)); left: calc(12px + var(--sa-l)); right: calc(12px + var(--sa-r)); }
.rail { left: calc(12px + var(--sa-l)); top: calc(74px + var(--sa-t)); max-height: calc(100% - 86px - var(--sa-t) - var(--sa-b)); }
.feed { left: calc(100px + var(--sa-l)); bottom: calc(12px + var(--sa-b)); }
.enkichip { right: calc(12px + var(--sa-r)); bottom: calc(12px + var(--sa-b)); }
.vdock { right: calc(12px + var(--sa-r)); bottom: calc(84px + var(--sa-b)); }
#stick { left: calc(18px + var(--sa-l)); bottom: calc(96px + var(--sa-b)); }
.vstick { left: calc(14px + var(--sa-l)); bottom: calc(88px + var(--sa-b)); }
.vpad .vbtn { right: calc(12px + var(--sa-r)); }
.vpad .vup { bottom: calc(284px + var(--sa-b)); } .vpad .vdn { bottom: calc(218px + var(--sa-b)); }
.vpad .vfast { left: calc(14px + var(--sa-l)); bottom: calc(226px + var(--sa-b)); }
@media (max-width: 760px) {
  .rail { top: auto; bottom: calc(8px + var(--sa-b)); left: calc(8px + var(--sa-l)); right: calc(8px + var(--sa-r)); max-height: none; }
  .feed { left: calc(8px + var(--sa-l)); right: calc(76px + var(--sa-r)); bottom: calc(78px + var(--sa-b)); }
  .enkichip { right: calc(8px + var(--sa-r)); bottom: auto; top: calc(108px + var(--sa-t)); }
  .cue { left: calc(8px + var(--sa-l)); top: calc(108px + var(--sa-t)); }
  .sheet { top: calc(64px + var(--sa-t)); bottom: calc(78px + var(--sa-b)); }
  .vdock { right: calc(8px + var(--sa-r)); bottom: calc(80px + var(--sa-b)); }
  .vlist { left: calc(8px + var(--sa-l)); right: calc(76px + var(--sa-r)); width: auto; max-width: none; bottom: calc(80px + var(--sa-b)); padding: 10px; }
  .vgrid { gap: 4px; } .vseat { font-size: 11.5px; } .vface { width: 48px; height: 48px; }
  .vchip, #followchip { top: calc(164px + var(--sa-t)); left: calc(8px + var(--sa-l)); right: calc(8px + var(--sa-r)); transform: none; max-width: none; justify-content: center; }
  .vpad .vbtn { right: calc(8px + var(--sa-r)); }
  .vstick { left: calc(10px + var(--sa-l)); bottom: calc(84px + var(--sa-b)); }
  .vpad .vfast { left: calc(10px + var(--sa-l)); bottom: calc(222px + var(--sa-b)); }
}

#vmore { display: none; width: 44px; height: 40px; padding: 0; place-items: center; font: 700 18px/1 var(--body); color: var(--ink); letter-spacing: .05em; }
#vmore[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }

@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  body.vfollow:not(.vtop-open) .top > :not(.brand):not(.spacer):not(#lock):not(#vmore),
  body.freefly:not(.vtop-open) .top > :not(.brand):not(.spacer):not(#lock):not(#vmore),
  body.sheet-open:not(.vtop-open) .top > :not(.brand):not(.spacer):not(#lock):not(#vmore) { display: none !important; }
  body.vfollow:not(.vtop-open) .top .brand span, body.freefly:not(.vtop-open) .top .brand span, body.sheet-open:not(.vtop-open) .top .brand span { display: none; }
  body.vfollow:not(.vtop-open) .top .spacer, body.freefly:not(.vtop-open) .top .spacer, body.sheet-open:not(.vtop-open) .top .spacer { display: block; }
  body.vfollow #vmore, body.freefly #vmore, body.sheet-open #vmore { display: grid; }
  body.vtop-open .top { z-index: 8; }
  body.vfollow:not(.vtop-open) #followchip, body.freefly:not(.vtop-open) .vchip { top: calc(64px + var(--sa-t)); }
  body.vfollow:not(.vtop-open) .lvline, body.freefly:not(.vtop-open) .lvline { top: calc(108px + var(--sa-t)); }
}
@media (max-width: 370px) { .vstick { width: 112px; height: 112px; } .vstick i { left: 31px; top: 31px; } }

@media (pointer: coarse) and (max-height: 500px) {
  .rail { top: auto; bottom: calc(8px + var(--sa-b)); left: calc(8px + var(--sa-l)); right: calc(8px + var(--sa-r)); flex-direction: row; max-height: none; }
  .rail a { flex: none; width: 58px; } .rail hr { display: none; }
  .feed { left: calc(8px + var(--sa-l)); right: auto; width: min(360px, calc(100% - 92px - var(--sa-l) - var(--sa-r))); bottom: calc(78px + var(--sa-b)); }
  .feed li:nth-child(n+3) { display: none; }
  .enkichip { bottom: auto; top: calc(64px + var(--sa-t)); right: calc(8px + var(--sa-r)); padding: 7px 11px; }
  body.walking .enkichip, body.vfollow .enkichip, body.vlist-open .enkichip { display: none; }
  .cue { left: calc(8px + var(--sa-l)); top: calc(64px + var(--sa-t)); }
  .sheet { top: calc(64px + var(--sa-t)); bottom: calc(80px + var(--sa-b)); left: calc(8px + var(--sa-l)); right: calc(76px + var(--sa-r)); width: auto; }
  .vdock { right: calc(8px + var(--sa-r)); bottom: calc(80px + var(--sa-b)); }
  .vlist { left: calc(8px + var(--sa-l)); right: calc(76px + var(--sa-r)); bottom: calc(12px + var(--sa-b)); max-height: calc(100% - 24px - var(--sa-t) - var(--sa-b)); }
  body.vfollow:not(.vtop-open) .rail, body.freefly:not(.vtop-open) .rail { display: none; }
  body.vfollow:not(.vtop-open) .vdock, body.freefly:not(.vtop-open) .vdock { bottom: calc(12px + var(--sa-b)); }
  .vpad .vbtn { right: calc(8px + var(--sa-r)); }
  .vpad .vdn { bottom: calc(144px + var(--sa-b)); } .vpad .vup { bottom: calc(210px + var(--sa-b)); }
  .vstick { left: calc(10px + var(--sa-l)); bottom: calc(12px + var(--sa-b)); }
  .vpad .vfast { left: calc(10px + var(--sa-l)); bottom: calc(150px + var(--sa-b)); }
  body.vfollow:not(.vtop-open) #followchip, body.freefly:not(.vtop-open) .vchip { top: calc(62px + var(--sa-t)); left: calc(8px + var(--sa-l)); right: auto; transform: none; max-width: calc(100% - 170px - var(--sa-l) - var(--sa-r)); }
  .vchip .vtouch { display: none; }
  body.vtop-open .vpad, body.vtop-open .vchip, body.vtop-open #followchip, body.vlist-open .vchip, body.vlist-open #followchip { display: none !important; }
}
@media (pointer: coarse) and (max-height: 400px) { .vstick { width: 100px; height: 100px; } .vstick i { left: 25px; top: 25px; } .vpad .vfast { bottom: calc(122px + var(--sa-b)); } }

.vdock { z-index: 7; } .sheet { padding-bottom: 150px; }

body.sheet-open .vdock #vfly { display: none; } body.sheet-open .sheet { padding-bottom: 90px; }

@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) { body .hubbar { display: none; } }

body .hubbar { right: calc(84px + var(--sa-r)); }

@media (pointer: coarse) and (max-height: 500px) { .vlist { max-height: calc(100% - 118px - var(--sa-t) - var(--sa-b)); } }
@media (pointer: coarse) and (max-height: 400px) { .vface { width: 44px; height: 44px; } }
#vmore { height: 44px; } .vpad .vfast { height: 44px; } .vclose { width: 44px; height: 44px; }
