
:root{--bg:#17212a;--panel:#111b24;--text:#f4f6f8;--muted:#9db0bd;--accent:#f5d25b}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;background:var(--bg);font-family:Inter,system-ui;color:var(--text);overflow:hidden}
body{padding:2px}
.app{width:100vw;height:100dvh;margin:0;display:flex;flex-direction:column}
.top{display:none}
.workspace{display:flex;flex-direction:column;gap:2px;min-height:0;flex:1}
.panel{background:linear-gradient(180deg,#172531,#0f1820);border:1px solid #344b5c;border-radius:9px;box-shadow:0 8px 24px #0005}
.side{padding:3px;display:flex;align-items:center;justify-content:center;gap:3px;flex-wrap:nowrap;position:relative;z-index:100;flex:0 0 auto}
.stage{padding:0;min-height:0;flex:1;overflow:hidden}
.boardWrap{position:relative;height:100%;max-height:calc(100dvh - 42px);width:min(100%,calc((100dvh - 42px)*616/736));aspect-ratio:616/736;margin:0 auto}
.grid{position:absolute;left:1.2987%;top:1.087%;width:97.4026%;height:97.826%;display:grid;grid-template-columns:repeat(10,1fr);grid-template-rows:repeat(12,1fr);gap:0}
.cell{border:1px solid #ffffff0e;position:relative;cursor:pointer}
.cell:hover{box-shadow:inset 0 0 0 2px #f5d25baa;z-index:10}
.badge{position:absolute;right:1px;top:1px;font-size:7px;background:#14202add;padding:1px 2px;border-radius:3px;pointer-events:none}
.status{display:none}
svg{position:absolute;inset:0;width:100%;height:100%}
input[type=file]{display:none}

/* compact square toolbar */
.iconBtn,.trackMain,.trackChoice,.tool,label.file,.menuAction{
 width:34px;height:34px;min-width:34px;border:1px solid #405a6c;background:#263846;color:#fff;
 border-radius:7px;padding:3px;cursor:pointer;display:grid;place-items:center
}
.iconBtn svg,.tool svg,.menuAction svg,.groupMain svg,.trackMain>svg{width:25px;height:25px;display:block;position:static;inset:auto}
.tool.active,.trackChoice.active,.trackMain.active,.iconBtn.active{border-color:var(--accent);box-shadow:inset 0 0 0 2px #f5d25b55}
.trackGroups{display:flex;gap:3px;position:relative}
.trackGroup,.toolGroup{position:relative}
.trackMain{margin:0}
.trackPreview{display:block;width:28px;height:22px;margin:0 auto}
.trackPreview svg{width:100%;height:100%;display:block;position:static}
.trackFlyout,.toolFlyout{
 display:none;position:absolute;left:0;top:38px;z-index:200;
 grid-template-columns:repeat(4,34px);gap:3px;padding:4px;background:#111b24;
 border:1px solid #405a6c;border-radius:8px;box-shadow:0 10px 28px #0009
}
.trackGroup.open .trackFlyout,.toolGroup.open .toolFlyout,.trackGroup:focus-within .trackFlyout,.toolGroup:focus-within .toolFlyout{display:grid}
.trackGroup:nth-child(n+3) .trackFlyout,.toolGroup.end .toolFlyout{left:auto;right:0}
.trackChoice{font-size:0}
.groupMain{width:34px;height:34px;min-width:34px;border:1px solid #405a6c;background:#263846;color:#fff;border-radius:7px;padding:3px;display:grid;place-items:center;cursor:pointer}
.groupMain svg{width:25px;height:25px;position:static}
.menuFlyout{grid-template-columns:repeat(3,34px)}
.decorFlyout{grid-template-columns:repeat(5,34px)}
.stationFlyout,.trainFlyout,.destFlyout{grid-template-columns:repeat(4,34px)}
.signalMark{font-size:9px;font-weight:900;position:absolute;right:2px;bottom:1px}
.tool{position:relative}

/* no visible captions anywhere */
small,.title,.desc,h1{display:none!important}
.actions{display:contents}
.waterGlint{stroke:#ffffffaa;stroke-width:2.2;fill:none;stroke-linecap:round;stroke-dasharray:10 18;animation:waterFlow 2.8s linear infinite}
.waterGlint.g2{animation-delay:-1.35s;opacity:.55}
@keyframes waterFlow{to{stroke-dashoffset:-56}}

@media(max-width:480px){
 body{padding:1px}
 .app{width:100vw}
 .side{padding:2px;gap:2px;border-radius:0}
 .stage{padding:0;border-radius:0}
 .iconBtn,.trackMain,.trackChoice,.tool,label.file,.menuAction,.groupMain{width:28px;height:28px;min-width:28px;border-radius:5px;padding:2px}
 .iconBtn svg,.tool svg,.menuAction svg,.groupMain svg,.trackMain>svg{width:21px;height:21px}
 .trackPreview{width:23px;height:18px}
 .trackFlyout,.toolFlyout{top:31px;grid-template-columns:repeat(4,28px);gap:2px;padding:3px}
 .decorFlyout{grid-template-columns:repeat(5,28px)}
 .stationFlyout,.trainFlyout,.destFlyout{grid-template-columns:repeat(4,28px)}
 .boardWrap{max-height:calc(100dvh - 34px);width:min(100%,calc((100dvh - 34px)*616/736))}
}

.iconBtn img,.tool img,.menuAction img,.groupMain img,.trackMain>img{
  width:25px;height:25px;display:block;object-fit:contain;pointer-events:none
}
.eraseMain>img{width:18px;height:18px}
@media(max-width:480px){
 .iconBtn img,.tool img,.menuAction img,.groupMain img,.trackMain>img{width:21px;height:21px}
 .eraseMain>img{width:17px;height:17px}
}

.playbackControls{display:flex;gap:3px;align-items:center}





.playbackControls{display:flex;gap:3px;align-items:center}




/* v6.8.2: playback buttons use EXACTLY the same shell as the rest of toolbar.
   Only their interior glyph/text uses the rail-like gray/brown tone. */
.playbackControls{display:flex;gap:3px;align-items:center}
.playbackControls .iconBtn{
  background:#263846;
  border:1px solid #405a6c;
  box-shadow:none;
}
.playbackControls .iconBtn:hover{
  background:#263846;
}
.playbackControls .iconBtn.active{
  border-color:#405a6c;
  box-shadow:none;
}
.playbackControls .iconBtn svg,
.playbackControls .iconBtn{
  color:#806f60;
}
.playbackControls .speedBtn{
  font:800 11px/1 Inter,system-ui;
  padding:0;
  letter-spacing:-.2px;
  color:#806f60;
}
