/* The Line Wafer. Designed at 430 px first; the desktop is the same layout with
   more room. One canvas, three chrome strips, nothing that scrolls the page. */

:root{
  --ink:#d8dee9; --dim:#8b93a7; --ground:#0b0d12; --edge:#1b2030;
  --lit:#ffd54a; --beam:#5ec8f2;
  --top:env(safe-area-inset-top,0px); --bot:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--ground); color:var(--ink);
  font:13px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  overflow:hidden; overscroll-behavior:none; -webkit-text-size-adjust:100%;
}
#stage{position:fixed; inset:0; width:100%; height:100%; display:block; touch-action:none}

#bar{
  position:fixed; left:0; right:0; top:0; z-index:2;
  display:flex; gap:.75rem; align-items:baseline; flex-wrap:wrap;
  padding:calc(var(--top) + .5rem) .75rem .5rem;
  background:linear-gradient(#0b0d12ee,#0b0d1200); pointer-events:none;
}
#wordmark{letter-spacing:.14em; font-size:11px}
.dim{color:var(--dim)}

#beam{
  position:fixed; z-index:3; left:.5rem; right:.5rem;
  bottom:calc(var(--bot) + 3.4rem);
  display:flex; gap:.4rem;
}
#beam input{
  flex:1 1 0; min-width:0; padding:.6rem .55rem;
  background:#11151f; color:var(--ink); border:1px solid var(--edge); border-radius:6px;
  font:inherit; font-size:16px; /* 16px stops iOS zooming the page on focus */
}
#beam input:focus{outline:none; border-color:var(--beam)}
#beam button{
  flex:0 0 auto; padding:.6rem .9rem; border-radius:6px; cursor:pointer;
  background:#11151f; color:var(--beam); border:1px solid var(--beam);
  font:inherit; font-size:13px; letter-spacing:.1em;
}
#beam button:active{background:#16202c}

#panel{
  position:fixed; z-index:4; left:.5rem; right:.5rem;
  bottom:calc(var(--bot) + 6.6rem);
  max-height:52vh; overflow:auto; -webkit-overflow-scrolling:touch;
  background:#0e121bf2; border:1px solid var(--edge); border-radius:8px;
  padding:.75rem .8rem 1rem;
}
#panel[hidden]{display:none!important}
#close{
  position:absolute; top:.35rem; right:.4rem; width:2rem; height:2rem;
  background:none; border:0; color:var(--dim); font:inherit; font-size:15px; cursor:pointer;
}
#panel h2{margin:0 .5rem .5rem 0; font-size:15px; font-weight:600; letter-spacing:.02em}
#panel h2 .n{color:var(--lit)}
#panel dl{display:grid; grid-template-columns:auto 1fr; gap:.15rem .6rem; margin:.5rem 0}
#panel dt{color:var(--dim)}
#panel dd{margin:0; overflow-wrap:anywhere}
#panel p{margin:.5rem 0 0}
#panel ul{margin:.35rem 0 0; padding-left:1.1rem}
#panel li{margin:.15rem 0}
.fam{color:var(--beam)}
.refuse{color:var(--lit)}

#foot{
  position:fixed; z-index:2; left:0; right:0; bottom:0;
  display:flex; gap:.15rem; flex-direction:column;
  padding:.35rem .75rem calc(var(--bot) + .35rem);
  background:linear-gradient(#0b0d1200,#0b0d12ee); pointer-events:none;
  font-size:10.5px;
}
#hint{text-align:left}
#foot a{color:var(--beam); pointer-events:auto; text-decoration:underline}

@media (min-width:760px){
  #beam{left:auto; right:1rem; width:26rem; bottom:calc(var(--bot) + 2.9rem)}
  #foot{flex-direction:row; gap:.6rem; justify-content:space-between}
  #hint{text-align:right}
  #panel{left:1rem; right:auto; width:26rem; bottom:calc(var(--bot) + 2.5rem); max-height:66vh}
  #foot{font-size:11px}
}
/* ── reading the code ───────────────────────────────────────────────────── */
/* ── reading the code ─────────────────────────────────────────────────────
   The line and the block are the only places in this page where the estate's
   own text appears. Everything else is drawn from numbers; this is fetched,
   one row at a time, and it is set apart so you can always tell which is
   which. */
.code{margin:.4rem 0 .6rem;padding:.45rem .55rem;background:#0b0e15;border:1px solid #1b2030;border-left:2px solid #5ec8f2;
      border-radius:4px;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#cfe3f2;
      white-space:pre-wrap;overflow-wrap:anywhere;max-height:14rem;overflow:auto}
.code.loading{color:#8b93a7;border-left-color:#1b2030;font-style:italic}
.code.refuse{color:#f2b05e;border-left-color:#f2b05e;white-space:normal;font-style:normal}
.code[data-empty="1"]::after{content:"an empty line";color:#5b6377;font-style:italic}

.famopen{display:block;width:100%;text-align:left;background:none;border:0;padding:.2rem 0;color:inherit;font:inherit;cursor:pointer}
.famopen:hover .fam{text-decoration:underline}
.famopen.open .fam::before{content:"▾ "}
.famopen:not(.open) .fam::before{content:"▸ "}

.famblock{margin:.3rem 0 .6rem}
.famhead{font-size:11px;letter-spacing:.04em;color:#e7ebf3;margin:.2rem 0}
ol.block{list-style:none;margin:.2rem 0;padding:0;border:1px solid #1b2030;border-radius:4px;overflow:hidden}
ol.block li+li{border-top:1px solid #141925}
.blockline{display:flex;gap:.5rem;width:100%;text-align:left;background:#0b0e15;border:0;padding:.22rem .45rem;
           color:#cfe3f2;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}
.blockline:hover{background:#121826}
.blockline .n{flex:0 0 4.5rem;color:#5b6377;text-align:right;user-select:none}
.blockline code{white-space:pre-wrap;overflow-wrap:anywhere}
#storeline{font-size:10.5px;margin:.5rem 0 0}
