@import url('/fonts/mono/index.css');

:root {
  --bg: #0b0b0a; --bg-2: #121210; --bg-3: #191916;
  --ink: #e8e4d8; --ink-2: #b7b3a8; --dim: #85827a; --line: #34322d; --line-2: #4a4740;
  --hot: #ff6a1a; --hot-2: #ff8a4a; --ok: #b8e986; --bad: #ff5a4f;
  --mono: 'JetBrains Mono Variable', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --pad: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 400 12.5px/1.5 var(--mono); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { color: var(--hot); text-decoration-color: var(--hot); }
button { font: inherit; color: inherit; }
::selection { background: var(--hot); color: var(--bg); }
.hot { color: var(--hot); } .dim { color: var(--dim); } .ok { color: var(--ok); } .bad { color: var(--bad); }

#city { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: var(--bg); touch-action: none; }
.crt { position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }

/* ---------- box primitive: thin frame + ascii corners + title on the border ---------- */
.box { position: relative; border: 1px solid var(--line-2); background: rgba(11,11,10,.86); backdrop-filter: blur(2px); }
.box::before, .box::after { content: '+'; position: absolute; color: var(--dim); line-height: 1; font-size: 13px; }
.box::before { top: -7px; left: -4px; } .box::after { bottom: -7px; right: -4px; }
.box > .t { position: absolute; top: -9px; left: 12px; padding: 0 6px; background: var(--bg); color: var(--ink); letter-spacing: .12em; font-weight: 700; font-size: 11px; text-transform: uppercase; white-space: nowrap; }
.box > .t::before { content: '[ '; color: var(--dim); } .box > .t::after { content: ' ]'; color: var(--dim); }
.box > .t .live { color: var(--hot); }

/* ---------- top bar ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 16px 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; gap: 6px; }
.logo { margin: 0; font-size: 7.4px; line-height: 1.02; color: var(--ink); letter-spacing: 0; user-select: none; text-shadow: 0 0 12px rgba(232,228,216,.15); }
.logo b { color: var(--hot); font-weight: inherit; }
.tag { font-size: 10.5px; letter-spacing: .24em; color: var(--ink-2); text-transform: uppercase; }
.tag .blink { color: var(--hot); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; max-width: 64vw; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line-2); background: rgba(11,11,10,.9); color: var(--ink); cursor: pointer; text-decoration: none; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; font-weight: 600; white-space: nowrap; }
.btn::before { content: '['; color: var(--dim); } .btn::after { content: ']'; color: var(--dim); }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.hot { background: var(--hot); color: var(--bg); border-color: var(--hot); }
.btn.hot::before, .btn.hot::after { color: rgba(11,11,10,.55); }
.btn.hot:hover { background: var(--hot-2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.ca { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.state-pill { padding: 7px 10px; border: 1px solid var(--line-2); background: rgba(11,11,10,.9); font-size: 11px; letter-spacing: .12em; white-space: nowrap; }
.state-pill i { font-style: normal; display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: var(--dim); vertical-align: 1px; }
.state-pill.open i { background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: blink 1.6s steps(1) infinite; }
.state-pill.off i { background: var(--hot); }

/* ---------- side panels ---------- */
.panel { position: fixed; z-index: 4; top: 132px; bottom: 58px; width: 380px; display: flex; flex-direction: column; }
.panel.left { left: 16px; } .panel.right { right: 16px; }
.panel .tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); padding: 14px 10px 0; }
.panel .tabs button { background: none; border: 0; padding: 4px 10px 8px; color: var(--dim); cursor: pointer; letter-spacing: .1em; font-size: 11px; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.panel .tabs button.on { color: var(--ink); border-bottom-color: var(--hot); }
.scroll { overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.scroll::-webkit-scrollbar { width: 6px; } .scroll::-webkit-scrollbar-thumb { background: var(--line-2); }

.tape { list-style: none; margin: 0; padding: 6px 0; }
.tape li { display: grid; grid-template-columns: 44px 1fr auto; gap: 0 8px; padding: 4px 12px; border-bottom: 1px dashed #24231f; font-size: 11.5px; cursor: default; }
.tape li.new { animation: flashrow 1.4s ease-out; }
@keyframes flashrow { from { background: rgba(255,106,26,.16); } to { background: transparent; } }
.tape .seq { color: var(--dim); }
.tape .route { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape .route .arr { color: var(--hot); }
.tape .amt { color: var(--hot); text-align: right; font-weight: 700; }
.tape .memo { grid-column: 2 / 4; color: var(--dim); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape .hash { grid-column: 2 / 4; color: #5d5a53; font-size: 10px; }
.acct { cursor: pointer; } .acct:hover { color: var(--hot); }

.events { list-style: none; margin: 0; padding: 6px 0; }
.events li { padding: 5px 12px; border-bottom: 1px dashed #24231f; font-size: 11.5px; color: var(--ink-2); }
.events li time { color: var(--dim); margin-right: 8px; }
.events li .k { display: inline-block; min-width: 62px; color: var(--dim); text-transform: uppercase; font-size: 10px; letter-spacing: .1em; }
.events li.bankrupt, .events li.fail { color: var(--bad); }
.events li.done .k, .events li.win .k, .events li.hire .k { color: var(--hot); }

.jobs { list-style: none; margin: 0; padding: 6px 0; }
.jobs li { padding: 9px 12px; border-bottom: 1px dashed #24231f; cursor: pointer; }
.jobs li:hover { background: rgba(232,228,216,.04); }
.jobs li.sel { background: rgba(255,106,26,.07); box-shadow: inset 2px 0 0 var(--hot); }
.jobs .jt { display: flex; gap: 8px; font-weight: 600; }
.jobs .jt .id { color: var(--dim); font-weight: 400; }
.jobs .jt .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs .jm { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 11px; margin-top: 3px; }
.bar { color: var(--ink-2); letter-spacing: 0; white-space: pre; }
.bar .f { color: var(--hot); }
.st { text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; }
.st.done { color: var(--ok); } .st.failed { color: var(--bad); } .st.working, .st.auction, .st.review { color: var(--hot); }

.panel .foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--dim); font-size: 11px; }

/* ---------- ticker ---------- */
.ticker { position: fixed; z-index: 4; left: 16px; right: 16px; bottom: 12px; display: flex; gap: 0; border: 1px solid var(--line-2); background: rgba(11,11,10,.9); overflow: hidden; }
.ticker div { flex: 1; padding: 7px 12px; border-right: 1px solid var(--line); white-space: nowrap; min-width: 0; }
.ticker div:last-child { border-right: 0; flex: 1.6; }
.ticker span { display: block; color: var(--dim); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; }
.ticker b { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 700; }
.ticker b.hot { color: var(--hot); }
.ticker .hash { font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--ink-2); }

/* ---------- tower labels ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.lbl { position: absolute; transform: translate(-50%, -100%); font-size: 10px; line-height: 1.2; white-space: nowrap; color: var(--ink-2); text-align: center; pointer-events: auto; cursor: pointer; padding-bottom: 8px; transition: opacity .25s; }
.lbl::after { content: ''; position: absolute; left: 50%; bottom: 0; height: 7px; border-left: 1px solid var(--line-2); }
.lbl b { display: block; color: var(--ink); background: rgba(11,11,10,.82); padding: 1px 5px; border: 1px solid var(--line); font-weight: 600; letter-spacing: .04em; }
.lbl i { font-style: normal; color: var(--dim); font-weight: 400; }
.lbl.sel i { color: rgba(11,11,10,.6); }
.lbl.work b { border-color: var(--hot); color: var(--hot); }
.lbl.sel b { background: var(--hot); color: var(--bg); border-color: var(--hot); }
.lbl.hov b { border-color: var(--ink); }
.lbl.far { opacity: .55; }

/* ---------- drawer ---------- */
.drawer { position: fixed; z-index: 8; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--bg); border-left: 1px solid var(--line-2); transform: translateX(102%); transition: transform .32s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer .dh { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 10px; }
.drawer .dh .crumb { color: var(--dim); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; }
.drawer .db { padding: 18px 18px 60px; }
.x { background: none; border: 1px solid var(--line-2); width: 30px; height: 30px; cursor: pointer; color: var(--ink); }
.x:hover { border-color: var(--hot); color: var(--hot); }
h2.ttl { font-size: 19px; line-height: 1.3; margin: 0 0 6px; font-weight: 700; letter-spacing: -.01em; }
.meta { color: var(--dim); font-size: 11.5px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 18px; }
.meta b { color: var(--ink); font-weight: 600; }
.pipe { white-space: pre; font-size: 11.5px; color: var(--dim); margin: 0 0 20px; overflow-x: auto; padding: 10px 12px; border: 1px dashed var(--line-2); }
.pipe .on { color: var(--hot); font-weight: 700; } .pipe .ok { color: var(--ink); }
.sec { margin: 22px 0 10px; color: var(--ink); letter-spacing: .14em; font-size: 11px; text-transform: uppercase; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.sec::after { content: ''; flex: 1; border-top: 1px dashed var(--line-2); }
.brief { color: var(--ink-2); white-space: pre-wrap; margin: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.t th { text-align: left; color: var(--dim); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: 10px; border-bottom: 1px solid var(--line-2); padding: 5px 6px; }
table.t td { border-bottom: 1px dashed #26251f; padding: 5px 6px; vertical-align: top; }
table.t td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.won td { color: var(--hot); }
.sub { border: 1px solid var(--line); margin-bottom: 10px; }
.sub > header { display: flex; justify-content: space-between; padding: 7px 10px; background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: 11.5px; gap: 8px; }
.sub > header b { text-transform: uppercase; letter-spacing: .1em; }
.sub details { padding: 0 10px; }
.sub summary { cursor: pointer; padding: 7px 0; color: var(--dim); font-size: 11px; }
.sub .brief { padding: 8px 10px 0; font-size: 11.5px; }
.score { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stars { letter-spacing: .1em; color: var(--hot); }

/* markdown output */
.md { color: var(--ink); font-size: 12.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { font-size: 13.5px; margin: 18px 0 8px; letter-spacing: .02em; }
.md h1::before { content: '# '; color: var(--hot); } .md h2::before { content: '## '; color: var(--hot); } .md h3::before { content: '### '; color: var(--hot); }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md ul { list-style: none; } .md ul li::before { content: '- '; color: var(--hot); margin-left: -14px; }
.md code { background: var(--bg-3); padding: 1px 5px; border: 1px solid var(--line); }
.md pre { background: var(--bg-2); border: 1px solid var(--line); padding: 12px; overflow-x: auto; margin: 0 0 12px; }
.md pre code { background: none; border: 0; padding: 0; font-size: 11.5px; line-height: 1.55; }
.md pre[data-lang]::before { content: attr(data-lang); display: block; color: var(--dim); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.md table { border-collapse: collapse; margin: 0 0 12px; font-size: 11.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line-2); padding: 5px 8px; text-align: left; }
.md th { background: var(--bg-2); }
.md hr { border: 0; border-top: 1px dashed var(--line-2); margin: 16px 0; }
.md .svg { border: 1px solid var(--line); padding: 14px; background: repeating-linear-gradient(0deg, transparent 0 19px, #191916 19px 20px), repeating-linear-gradient(90deg, transparent 0 19px, #191916 19px 20px); margin: 0 0 12px; text-align: center; }
.md .svg img { max-width: 100%; max-height: 380px; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 2px solid var(--hot); color: var(--ink-2); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; background: rgba(5,5,4,.72); padding: 16px; }
.modal.on { display: flex; }
.modal .box { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 50px 22px 22px; background: var(--bg); }
.modal .box > .t { top: 16px; left: 18px; padding: 0; }
.modal .close { position: absolute; top: 10px; right: 10px; }
.modal p { color: var(--ink-2); margin: 0 0 12px; }
label.f { display: block; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; margin: 14px 0 6px; }
label.f small { text-transform: none; letter-spacing: 0; float: right; }
input.in, textarea.in { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); padding: 10px 12px; font: 400 13px/1.5 var(--mono); outline: none; resize: vertical; }
input.in:focus, textarea.in:focus { border-color: var(--hot); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.msg { min-height: 1.4em; margin-top: 10px; font-size: 12px; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
pre.code { background: var(--bg-2); border: 1px solid var(--line); padding: 12px; overflow-x: auto; font-size: 11.5px; line-height: 1.55; margin: 0 0 12px; color: var(--ink-2); }
pre.code .c { color: var(--dim); } pre.code .k { color: var(--hot); }
pre.diagram { color: var(--ink-2); font-size: 11.5px; line-height: 1.35; overflow-x: auto; margin: 4px 0 16px; }
pre.diagram b { color: var(--hot); font-weight: 600; }
.verify-out { white-space: pre-wrap; font-size: 12px; color: var(--ink-2); min-height: 120px; }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; transition: opacity .5s; }
#boot.off { opacity: 0; pointer-events: none; }
#boot pre { margin: 0; overflow: hidden; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); min-width: min(560px, 100%); }
#boot pre b { color: var(--hot); font-weight: 600; } #boot pre i { font-style: normal; color: var(--ok); }
.cursor::after { content: '█'; color: var(--hot); animation: blink 1s steps(1) infinite; }

/* ---------- toast / banner ---------- */
.banner { position: fixed; z-index: 5; left: 50%; top: 136px; transform: translateX(-50%); padding: 10px 16px; text-align: center; white-space: nowrap; }
.banner b { color: var(--hot); }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 70px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; padding: 8px 14px; background: var(--ink); color: var(--bg); font-weight: 600; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.mtabs { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) { .panel { width: 330px; } }
@media (max-width: 1020px) { .panel.left { display: none; } .ticker div:nth-child(6) { display: none; } }
@media (max-width: 760px) {
  body { font-size: 12px; }
  .top { padding: 10px 12px 0; flex-direction: column; gap: 8px; }
  .logo { font-size: 5.6px; }
  .tag { font-size: 9px; letter-spacing: .18em; }
  .nav { max-width: none; justify-content: flex-start; gap: 6px; }
  .nav .opt { display: none; }
  .btn { padding: 6px 9px; font-size: 10.5px; }
  .panel, .panel.left { display: none; top: auto; left: 0 !important; right: 0 !important; bottom: 52px; width: auto; height: 58vh; border-left: 0; border-right: 0; }
  .panel.m-on { display: flex; }
  .ticker { left: 0; right: 0; bottom: 52px; border-left: 0; border-right: 0; }
  .ticker div:nth-child(n+4) { display: none; }
  body.sheet .ticker { display: none; }
  .mtabs { display: flex; position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; height: 52px; background: var(--bg); border-top: 1px solid var(--line-2); }
  .mtabs button { flex: 1; background: none; border: 0; border-right: 1px solid var(--line); color: var(--dim); letter-spacing: .12em; font-size: 11px; text-transform: uppercase; }
  .mtabs button.on { color: var(--hot); box-shadow: inset 0 2px 0 var(--hot); }
  .banner { top: auto; bottom: 110px; white-space: normal; width: calc(100% - 32px); }
  .lbl { display: none; } .lbl.sel { display: block; }
  .drawer { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
