:root{
  --bg:#F4EFE3; --bg2:#EAE2D0; --ink:#0E1220; --ink2:#565B6B; --accent:#5468FF; --accent-ink:#F6F7FF;
  --line:rgba(14,18,32,.14); --slip:#FFFFFF; --hit:#1F8F5C;
  --serif:'Instrument Serif',Georgia,serif; --code2:'IBM Plex Mono',ui-monospace,monospace;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink); font-family:var(--code2); line-height:1.5;
  min-height:100vh; padding-bottom:calc(72px + env(safe-area-inset-bottom)); /* room for the fixed bottom dock */
}
a{color:inherit}
code,.code2{font-family:var(--code2)}
button{font-family:inherit; cursor:pointer}

/* ---------- the dock: the buy control, fixed at the bottom at every width ---------- */
.dock{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  display:flex; align-items:center; gap:10px;
  background:var(--ink); color:var(--accent-ink);
  border-top:2px solid var(--accent);
}
.brand{display:flex; align-items:center; gap:8px; text-decoration:none; color:inherit; flex:0 0 auto}
.brand img{width:26px; height:26px; border-radius:6px; display:block}
.brand span{font-family:var(--serif); font-weight:700; font-size:15px; letter-spacing:.02em}
.fare{
  flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:8px;
  background:rgba(255,255,255,.09); border-radius:8px; padding:6px 10px; overflow:hidden;
}
.fareLbl{flex:0 0 auto; font-size:10px; letter-spacing:.12em; opacity:.7; font-weight:600}
.fare code{flex:1 1 auto; min-width:0; overflow-x:auto; white-space:nowrap; font-size:12px; scrollbar-width:none}
.fare code::-webkit-scrollbar{display:none}
#copyCa{
  flex:0 0 auto; background:var(--accent); color:var(--accent-ink); border:none; border-radius:6px;
  padding:5px 10px; font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
}
#copyCa.stamped{background:var(--hit)}
.xlink{
  flex:0 0 auto; font-size:12px; font-weight:600; text-decoration:none; padding:6px 8px;
  border:1px solid rgba(255,255,255,.35); border-radius:6px; white-space:nowrap;
}
@media (max-width:480px){ .brand span{display:none} .xlink{font-size:0} .xlink::after{content:'GMGN'; font-size:11px} }

/* ---------- layout ---------- */
#view{max-width:1140px; margin:0 auto; padding:22px 16px 8px; font-size:18px}
.deck{display:grid; grid-template-columns:1fr; gap:18px}
@media (min-width:1000px){ .deck{grid-template-columns:minmax(0,1fr) 320px; align-items:start} }
.lane-main{display:flex; flex-direction:column; gap:18px; min-width:0}
.lane-side{display:flex; flex-direction:column; gap:16px; min-width:0}

.slip{background:var(--slip); border:1px solid var(--line); border-radius:16px; padding:20px}

/* ---------- hero: the ticket form ---------- */
.fareform .dispHead{font-family:var(--serif); font-size:clamp(28px,4.6vw,42px); line-height:1.05; margin:0 0 8px; font-weight:400}
.fareform .lede{font-size:14px; color:var(--ink2); max-width:56ch; margin:0 0 16px}
.statrow{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px}
.fact{flex:1 1 120px; background:var(--bg2); border-radius:10px; padding:10px 12px}
.fact .fk{display:block; font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink2)}
.fact .fv{display:block; font-family:var(--code2); font-size:17px; font-weight:600; margin-top:2px}
.go{
  appearance:none; border:none; border-radius:10px; padding:14px 18px; font-weight:700; font-size:15px;
  letter-spacing:.01em; width:100%; font-family:var(--code2);
}
.go.solid{background:var(--accent); color:var(--accent-ink)}
.go.solid:disabled{background:#D9D2BF; color:#9C9481; cursor:not-allowed}
.go.outline{background:transparent; border:1.5px solid var(--ink); color:var(--ink); margin-top:10px}
.footnote{font-size:12px; color:var(--ink2); margin:10px 0 0}

/* ---------- the strip: the ticker of tickets ---------- */
.strip-head{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px}
.strip-head h3{font-family:var(--serif); font-size:19px; margin:0; font-weight:400}
.potReadout{font-family:var(--code2); font-size:13px; color:var(--ink2)}
.potReadout b{color:var(--ink)}
.frontline{
  display:flex; align-items:center; gap:12px; background:var(--bg2); border-radius:12px; padding:14px 16px; margin-bottom:14px;
}
.frontline .dot{width:10px; height:10px; border-radius:50%; background:var(--accent); flex:0 0 auto; box-shadow:0 0 0 4px rgba(84,104,255,.18)}
.frontline .dot.idle{background:#B7AF98; box-shadow:none}
.frontline .info{min-width:0}
.frontline .tag{font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink2)}
.frontline .person{font-family:var(--code2); font-size:15px; word-break:break-all}
.strip{
  display:flex; gap:10px; overflow-x:auto; padding:4px 2px 10px; scroll-snap-type:x proximity;
}
.strip::-webkit-scrollbar{height:6px}
.strip::-webkit-scrollbar-thumb{background:var(--line); border-radius:4px}
.tile{
  scroll-snap-align:start; flex:0 0 auto; width:132px; border:1.5px dashed var(--line); border-radius:12px;
  padding:10px 12px; background:var(--bg); position:relative;
}
.tile::before{content:''; position:absolute; left:-1px; top:50%; width:8px; height:8px; border-radius:50%; background:var(--bg); border:1.5px dashed var(--line); transform:translate(-50%,-50%)}
.tile::after{content:''; position:absolute; right:-1px; top:50%; width:8px; height:8px; border-radius:50%; background:var(--bg); border:1.5px dashed var(--line); transform:translate(50%,-50%)}
.tile .n{font-size:10px; color:var(--ink2); letter-spacing:.06em}
.tile .a{font-family:var(--code2); font-size:12.5px; margin:4px 0; word-break:break-all}
.tile .s{display:inline-block; font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:2px 6px; border-radius:5px}
.tile.front{border-style:solid; border-color:var(--accent); background:#EEF0FF}
.tile.front .s{background:var(--accent); color:var(--accent-ink)}
.tile.served .s{background:var(--hit); color:#fff}
.tile.waiting .s{background:var(--bg2); color:var(--ink2)}
.tile.cutin .s{background:#E9C24A; color:#3A2B00}
.blank{font-size:13px; color:var(--ink2); padding:10px 2px}

.cutform{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; border-top:1px dashed var(--line); margin-top:6px; padding-top:14px; font-size:13px}
.cutform button{width:auto; padding:9px 14px; font-size:13px}

/* ---------- aside: terms + tape ---------- */
.slip h3{font-family:var(--serif); font-size:17px; margin:0 0 10px; font-weight:400}
.terms dl{margin:0; display:grid; grid-template-columns:1fr auto; gap:8px 10px; font-size:12.5px}
.terms dt{color:var(--ink2)}
.terms dd{margin:0; font-family:var(--code2); font-weight:600; text-align:right}
.tape{display:flex; flex-direction:column; gap:10px; max-height:400px; overflow:auto}
.tape .entry{display:flex; flex-direction:column; gap:2px; padding-bottom:10px; border-bottom:1px dashed var(--line)}
.tape .entry:last-child{border-bottom:none; padding-bottom:0}
.tape .person{font-family:var(--code2); font-size:12px}
.tape .note{font-size:11px; color:var(--ink2)}

/* ---------- essay / how ---------- */
.essay{background:var(--slip); border:1px solid var(--line); border-radius:16px; padding:22px; max-width:70ch}
.essay h1{font-family:var(--serif); font-size:30px; margin:0 0 14px; font-weight:400}
.essay h3{font-family:var(--serif); font-size:18px; margin:20px 0 6px; font-weight:400}
.essay p{margin:0 0 4px; color:var(--ink2); font-size:14px}
.essay code{background:var(--bg2); padding:2px 5px; border-radius:4px}

/* ---------- sheet ---------- */
#sheet{position:fixed; inset:0; background:rgba(14,18,32,.45); z-index:60; display:flex; align-items:flex-end; justify-content:center}
#sheet[hidden]{display:none}
@media (min-width:640px){ #sheet{align-items:center} }
.ticket-slip{background:var(--slip); width:100%; max-width:480px; border-radius:16px 16px 0 0; padding:18px; max-height:78vh; overflow:auto}
@media (min-width:640px){ .ticket-slip{border-radius:16px} }
.sheetTop{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.sheetTop span{font-family:var(--serif); font-weight:700; font-size:17px}
#sheetClose{background:none; border:none; font-size:22px; line-height:1; color:var(--ink2)}

/* ---------- bubble ---------- */
.bubble{position:fixed; left:50%; bottom:calc(84px + env(safe-area-inset-bottom)); transform:translateX(-50%); background:var(--ink); color:var(--accent-ink); padding:10px 16px; border-radius:8px; font-size:13px; z-index:80; opacity:0; animation:toastin .25s ease-out forwards}
@keyframes toastin{to{opacity:1}}
.pulse{animation:hitflash 900ms ease-out}
@keyframes hitflash{0%{box-shadow:0 0 0 0 rgba(84,104,255,.5)} 100%{box-shadow:0 0 0 18px rgba(84,104,255,0)}}

/* ---------- footer ---------- */
.stub{max-width:1140px; margin:0 auto; padding:20px 16px 20px; font-size:11.5px; color:var(--ink2); display:flex; flex-direction:column; gap:6px}
.stub .sline{display:flex; gap:8px; align-items:baseline}
.stub .fk{text-transform:uppercase; letter-spacing:.08em; font-size:10px}
.stub code{word-break:break-all}
.stub .slinks{display:flex; gap:14px; margin-top:6px}
.stub .slinks a{text-decoration:underline}
.stag{margin-top:8px; font-style:italic}
