html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #e2e8f0;
}

[hidden] { display: none !important; }

.c2d-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid #334155;
  backdrop-filter: blur(6px);
}

.c2d-header h1 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.c2d-header a {
  color: #a5b4fc;
  text-decoration: none;
  font-size: 0.8125rem;
}

.c2d-header a:hover { text-decoration: underline; }

.c2d-badge {
  display: inline-flex;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  vertical-align: middle;
}

.c2d-main {
  position: absolute;
  inset: 0;
  top: 42px;
  bottom: 52px;
  display: flex;
  min-height: 0;
}

.c2d-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
  min-width: 0;
  min-height: 200px;
}

.c2d-canvas-wrap.is-panning { cursor: grabbing; }

#c2d-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.c2d-sidebar {
  width: 320px;
  max-width: 38vw;
  border-left: 1px solid #334155;
  background: rgba(15, 23, 42, 0.96);
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.8125rem;
}

.c2d-sidebar h2 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: #f1f5f9;
}

.c2d-layers label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.25rem 0;
  cursor: pointer;
}

.c2d-warn {
  margin: 0.75rem 0;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 0.75rem;
  line-height: 1.45;
}

.c2d-missing {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1.45;
}

.c2d-bar {
  position: absolute;
  left: 0;
  right: 320px;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid #334155;
}

@media (max-width: 900px) {
  .c2d-sidebar { display: none; }
  .c2d-bar { right: 0; }
}

.c2d-bar__controls { display: flex; gap: 0.35rem; }

.c2d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
}

.c2d-btn:hover { background: #334155; }
.c2d-btn--primary { background: #2563eb; border-color: #3b82f6; }
.c2d-btn--primary:hover { background: #1d4ed8; }
.c2d-btn svg { width: 1rem; height: 1rem; }

.c2d-bar__progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.c2d-bar__progress input[type="range"] { flex: 1; min-width: 0; }
.c2d-bar__time { font-size: 0.75rem; color: #94a3b8; white-space: nowrap; font-variant-numeric: tabular-nums; }

.c2d-bar__speed {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.c2d-message {
  position: absolute;
  inset: 42px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: #0f172a;
  z-index: 30;
}

.c2d-hint {
  position: absolute;
  left: 0.75rem;
  bottom: 0.5rem;
  z-index: 10;
  font-size: 0.6875rem;
  color: #64748b;
  pointer-events: none;
}

.c2d-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  font-size: 0.8125rem;
  color: #94a3b8;
  pointer-events: none;
}
