:root {
  --bg: #f4f6fb;
  --ink: #1f2933;
  --ink-soft: #54606b;
  --accent: #b8a4e3;
  --panel-bg: #ffffff;
  --panel-border: #e3e7ee;
  --shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
  --topbar-h: 64px;
  --panel-w: 320px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  z-index: 10;
  box-shadow: var(--shadow);
}

#topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

#topbar .hint {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

#stage {
  position: absolute;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
}

#canvas-root {
  position: absolute;
  inset: 0;
}

#canvas-root canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#panel {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  width: var(--panel-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  padding: 24px;
  z-index: 20;
  overflow-y: auto;
}

#panel.open {
  transform: translateX(0);
}

#panel-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px 8px;
  border-radius: 4px;
}

#panel-close:hover,
#panel-close:focus {
  color: var(--ink);
  background: var(--bg);
  outline: none;
}

#panel h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  padding-right: 32px;
}

#panel-short {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.4;
}

#panel-detail {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}
