:root {
  --bg: #ffffff;
  --border: rgba(0,0,0,0.08);
  --text: rgba(0,0,0,0.85);
  --muted: rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* Top bar */
#topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

#topbar .title { 
  font-weight: 600; 
  letter-spacing: 0.2px; 
}

#topbar .hint { 
  font-size: 12px; 
  color: var(--muted); 
}

/* Stage */
#stage { 
  position: relative; 
  height: calc(100% - 48px); 
  background: #ffffff;
}

/* Remove grid completely */
#grid {
  display: none;
}

/* Pan/zoom viewport */
#viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

#viewport.grabbing { 
  cursor: grabbing; 
}

/* Centered content anchor */
#content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 0;
  will-change: transform;
}

/* Empty state */
#empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  text-align: center;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  color: var(--text);
}

#empty .sub { 
  margin-top: 8px; 
  font-size: 12px; 
  color: var(--muted); 
}
#topbar .updated {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}


#topbar .controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

#refreshBtn {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
}

#refreshBtn:hover {
  background: #f5f5f5;
}

.hidden { display: none; }
